TutorialPost
Shipping it with a systemd unit
The last chapter puts the server on a real machine: a user of its own, a unit file, logs in journald and a restart when it falls over.
Types where they help, and the places where they did not.
TutorialPost
The last chapter puts the server on a real machine: a user of its own, a unit file, logs in journald and a restart when it falls over.
TutorialPost
Node ships a test runner. Twelve tests cover the router and the middleware, and none of them opens a port.
TutorialPost
A middleware is a function that takes a handler and returns a handler. Logging and a token check, nested without a framework.
Post
We parsed query strings by hand for an afternoon, then deleted it and used URLSearchParams. Notes from both sides of the keyboard.
1 min
TutorialPost
Each path gets its own handler, and /posts/:slug hands the slug over as a parameter. None of the 20 lines is a regular expression.
TutorialPost
Method, path, headers and body, turned into a standard Request. The server still answers everything with the same text.
TutorialPost
Chapter 1 of six: an empty folder, Node 24 and a server that says Hello to every request. No dependencies, now or later.
Post
Test first when I know what the answer should be. Code first when I am still finding out what the question is.
1 min