Node Servers and REST APIs
Learning Path ⋅ Skills: Node HTTP Servers, REST API Design, Express, Middleware, Validation With Zod, Error Responses, Environment Variables, CORS, Logging, API Testing
This learning path is for you if you already call APIs with fetch and write strict TypeScript, but have only ever been the client. You’ll need Node 26, a terminal, and an editor.
You’ll start with a server built on Node’s own node:http module, so you see the layer that a framework hides. Then you’ll move to Express 5 to design resources and routes, save data to a JSON file, and check every request with Zod. After that, you’ll read your API’s settings from environment variables and open it to a browser page on another origin.
Each course tells its own story, with coding exercises, a project, and a quiz. In the last course, you’ll test and document an API, then build one from a brief without a walkthrough.
Node Servers and REST APIs
Learning Path ⋅ 1 Resource
Is this path right for you? Mentor AI knows what’s in it and can help you decide where to begin.
Write Your First Server Without a Framework
Start on the server side of the request with nothing but Node’s node:http module. You’ll route requests by method and path, read JSON bodies, and answer each one with the right status code. Then you’ll build an allotment society’s plot board and check it with curl and fetch.
Build and Guard a REST API With Express
Having routed requests by hand, you’ll let Express 5 do that work. You’ll design the routes for a repair café’s ticket API, save tickets safely to a JSON file, and split the API into routers. Then you’ll check every request with Zod and send each failure as one consistent JSON error.
Get Your API Ready for Real Clients
An API that works from curl still needs settings, a browser front end, and logs. You’ll read configuration from environment variables checked at startup, allow one origin with CORS, and log each request as one JSON line without leaking secrets or phone numbers.
Test, Document, and Build an API on Your Own
Last, you’ll make sure an API does what it says. You’ll test it through real HTTP requests, error paths included, and write an endpoint reference whose examples run as tests. Then you’ll build a radio station’s song-request API from a brief, without a walkthrough.
Test Your Knowledge
You’ve made it through the path! In the wrap-up quiz below, you’ll revisit routing and status codes, REST design in Express, validation and error responses, configuration and CORS, and testing an API through HTTP.
Interactive Quiz
Node Servers and REST APIs
Check what you've learned about building REST APIs with Node and Express, from routes and status codes to validation, CORS, and API tests.
Congratulations on completing this learning path! You can now build a REST API in TypeScript from an empty folder, with resources and routes you designed, the right status codes, input checked at the boundary, and the same error shape for every failure.
You can also configure an API through environment variables, let a browser page on another origin call it, and log requests without leaking personal data. And you can test an API through real HTTP requests and write a reference that matches what it sends.
You might also be interested in these related learning paths:
Got feedback on this learning path?
Looking for real-time conversation? Visit the RealJS Community Chat or join the next “Office Hours” Live Q&A Session. Happy coding!