Express foundations
Create the application
Set up an Express 5 project with explicit scripts, environment requirements, and a minimal start file.
9 minute lesson
Start from the behavior you can observe. The notes app exports the Express application for tests and starts listening from a separate executable module.
The first application should reveal the server, port, and startup failure instead of hiding them behind scaffolding. The useful target is not encyclopedic coverage. Make one deliberate choice, observe its consequences, and know which requirement would make you revise it.
It is tempting to mix app construction, listener startup, tests, and environment mutation in one unimportable file. That trades a clear decision for an assumption you will eventually have to debug. The stronger move is to separate app creation from process startup and fail clearly when required configuration is missing. Make the boundary explicit in code and in the project notes.
Tie the decision back to the larger job: Start a small Express 5 application whose configuration and request path can be explained from the first byte. Record enough evidence that another developer can repeat the result without relying on your memory.
Start the app, import it without opening a port, and prove a test can exercise it in isolation. Repeat it once with an invalid or hostile condition and write down the boundary the failure revealed.
Lesson completed