Lesson 03 · Backend & Servers
REST APIs & JSON over HTTP
Serving data instead of pages: design a notes API from resource nouns and method verbs, answer with honest status codes, parse bodies and path parameters, then consume your own API from the browser.
Prerequisites: Node.js: JavaScript on a Server
Learning objectives
By the end of this lesson, you will be able to:
- Design REST endpoints for a resource - nouns in paths, verbs as methods
- Answer with honest status codes: 201 with Location for creates, 204 for deletes, 404 and 400 for misses
- Collect and parse request bodies safely, and read parameters out of the path
- Consume your own API from the browser with fetch, end to end