Lesson 05 · Backend & Servers
Backend Capstone — Build a Complete API
Build the Bookmarks API end to end: design the endpoints, validate every request, persist to a JSON file with atomic writes, test the handlers, and consume the API from a browser page.
Prerequisites: Persistence: Files & Databases
Learning objectives
By the end of this lesson, you will be able to:
- Design a complete REST API from a written spec: resources, methods, paths and status codes
- Write request validation that rejects bad input with honest 400 responses
- Route method + path to handlers with a small, readable router
- Persist the store to disk with an atomic tmp-file write
- Test API handlers as plain functions with node:test
- Consume your own API from the browser with fetch