Loading video player…

Building REST APIs With Express (Overview)

Welcome to Building REST APIs With Express! So far, you’ve been the client, reading the status and body an API sends back. In this course, you move to the other side of the request and write the server that decides them.

A First Taste

Here’s the ticket desk you’ll build for Dev’s repair café. When Dev logs Rosa’s radio, the API answers 201 Created, with the new ticket’s address in its Location header:

Language: Shell
$ curl -i -X POST http://localhost:3000/tickets \
  -H "Content-Type: application/json" \
  -d '{"name": "Rosa", "item": "radio", "category": "electrical",
       "fault": "No sound from the speaker"}'
HTTP/1.1 201 Created
X-Powered-By: Express
Location: /tickets/c4a04687-7168-425f-befc-1fa75dd62017
Content-Type: application/json; charset=utf-8
...

{"id":"c4a04687-...","name":"Rosa","item":"radio",...,"status":"waiting"}

Then Dev asks which electrical tickets are waiting, and the API answers with two, Priya’s toaster and Rosa’s radio:

Language: Shell
$ curl -i "http://localhost:3000/tickets?status=waiting&category=electrical"
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
...

{"items":[{"id":"1","name":"Priya",...},{...,"name":"Rosa",...}],"total":2,...}

Some headers and parts of each body are cut here, marked with ....

Dev’s Clipboard

Dev runs the sign-in desk at the Pembury Library repair café. On the first Saturday of every month, volunteers fix toasters, lamps, and torn jackets in the library hall. Every ticket goes on a clipboard, and the ticket API you build in this course will replace it.

What You’ll Learn

By the end of this course, you’ll be able to design a REST API’s resources and routes, and build it with Express 5: create, read, update, and delete through route parameters and query strings, with the data saved safely to a JSON file.

Express is an npm package for writing Node servers. The course builds the API in five sections:

  • Meet Express: You’ll rebuild one endpoint of a small plain-Node server with Express 5, to see what Express does for you.
  • Design the Ticket API: You’ll design the API’s resources and routes, then create, read, update, and delete tickets through route parameters and query strings.
  • Save Tickets Safely: You’ll save the tickets safely to a JSON file, so no ticket is lost when two arrive at once.
  • Split the API by Resource: You’ll give each resource its own router.
  • Project: The Repair Café Ticket API: You’ll build Dev’s full ticket API from a brief.

Before You Start

You should already be able to call APIs with fetch(), read a raw HTTP response, and run strict TypeScript directly with Node. You’ll need Node 26, a terminal, and any editor.

You don’t need an earlier server course. The course’s code download holds the starting project, that small plain-Node server, ready to begin from.

How the Course Works

The lessons are text and short videos. You type the code into the starting project on your own computer and call your server with curl -i after each change.

Each section ends with a coding exercise that you solve in your browser. The final project, Dev’s ticket API, ends with a mentor review, where you explain your code. A quiz closes the course. The same download also holds the finished code for each lesson, so you can compare your work.

Start with the first lesson, Rebuild an Endpoint in Express.

Download

Course Slides (.pdf)

958.0 KB
Download

Sample Code (.zip)

155.7 KB

00:00 Welcome to Building REST APIs With Express. So far, you’ve been the client, reading the status and body an API sends back. Now you write the server that decides them.

00:14 Here’s the ticket desk you’ll build for Dev’s repair café. Dev logs Rosa’s radio and gets 201 Created, with the new ticket’s address. Then Dev asks which electrical tickets are waiting.

00:27 Two, Priya’s toaster and Rosa’s radio.

00:32 Dev runs the sign-in desk at the Pembury Library repair café, where volunteers fix toasters, lamps, and torn jackets. Every ticket goes on a clipboard, and your API will replace it.

00:46 Express is an npm package for writing Node servers. First, you’ll rebuild one endpoint of a small plain-Node server in Express 5, to see what Express does.

00:57 You’ll design resources and routes, then create, read, update, and delete tickets with route parameters and query strings. You’ll save them safely to a JSON file, so no ticket is lost.

01:09 Each resource gets a router. Finally, you’ll build Dev’s full ticket API from a brief.

01:17 You should already call APIs with fetch(), read raw HTTP responses, and run strict TypeScript with Node. You’ll need Node 26, a terminal, and any editor.

01:29 No earlier server course is needed. The code download’s starting project is a small plain-Node server to begin from. You type the code into the starting project on your computer and test it with curl after each change.

01:43 Each section ends with a coding exercise in your browser. The final project ends with a mentor review, where you explain your code. A quiz closes the course.

01:54 The same download holds the finished code.

01:58 Start with the first lesson, Rebuild an Endpoint in Express.

Become a Member to join the conversation.