Building a Ruby web app using the Ruby Standard Library
summary
Builds a working step‑tracker web app from raw Ruby: opens a TCP server on port 9999, parses HTTP requests by hand (start line, headers, Content‑Length), decodes form bodies with URI.decode_www_form, and returns HTML pages; implements a POST /add_data that issues a 303 redirect back to the main page and persists entries to store.yaml using YAML::Store after discovering in‑memory state is lost on restart. Demonstrates netcat tests, shows the code is minimal but brittle, and notes how Rack/Puma, SQLite or Rails replace each piece.
AI-written summary · about
chapters (22)
- 0:00Introduction
- 1:20Overview
- 4:07Disclaimer
- 4:32How applications communicate
- 5:08Packet delivery
- 5:52TCP
- 6:31Port numbers
- 7:26Socket
- 7:57TCP Server
- 9:05Netcat
- 10:32Application Layer
- 11:54HTTP Communication
- 12:37Request vs Response
- 12:52Request and Response start lines
- 14:43HTTP request
- 18:11HTML form
- 19:20AllData variable
- 22:11POST decoding
- 23:46YAML store
- 25:44Summary
- 26:45Whats next
- 28:08Rails library replacement
related talks
33mWeb applications with Ruby (not Rails)
30mWeb Applications with Ruby (not Rails)
31mFrom Rails to the Web Server to the Browser
35mLet's build a simple HTTP server with Ruby
36mThe Little Server That Could
33mRack ‘em, Stack ‘em Web Apps
35mThe little server that could
30mFeats of Daring with the Ruby Standard Library
