-
Book Overview & Buying
-
Table Of Contents
Full-Stack React, TypeScript, and Node - Second Edition
By :
In this chapter, we explored Express, the most widely used framework for building web applications on top of Node.js. We started by understanding how Express improves on raw Node development through its middleware pipeline, where each request passes through a chain of functions that can inspect, modify, or respond before reaching the final route handler. We saw the difference between application-level middleware, route-level middleware, and error-handling middleware, and learned that Express identifies error handlers by their four-parameter signature.
We then built a RESTful web API with versioned endpoints, handled both GET and POST requests, parsed JSON request bodies, and used route parameters to retrieve specific resources. Along the way, we revisited HTTP fundamentals like status codes, headers, and the importance of following REST conventions, including the concept of idempotency.
Finally, we introduced integration testing with supertest and the Node test runner, verifying...
Change the font size
Change margin width
Change background colour