Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 03 · From Scratch · HTTP Server · with code: Go · about 28 min to read

Play it as a journeyTutor comes with a plan

HTTP 04: Routing and Response

Routing and Response
Routing and Response · Open board

Follows HTTP 03: Frame The Body, which found the exact last byte of an incoming request, and hands off to HTTP Keep-Alive.

Before you start. This series builds a small copy of a web server: a program that reads a request coming in over a network and sends back the right answer. So far it can open a connection, read the words a browser sends, and know exactly where they stop. This stage decides who answers a finished request, and what a correct answer even looks like.

Lesson 17 of 117 in From Scratch

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 1993: a page that has to run, not just sit there
  • The map, and the trap that lives in it
  • The reply nobody checks
  • The one function that refuses to lie
  • Registering routes, and why order cannot be the tie-breaker
  • The reply: a status line, then a contract
  • The writer that refuses to lie
  • What running it caught
  • What this board leaves behind

Terms it explains: server, request, bytes, handler, route, router, headers, status code, method, prefix, parameter, left to right, radix trie, cannot, 303 See Other, MUST.

Review From Scratch