DevPath · Learn to code ESPTEN

Capstone: a complete REST API

The plan: the tasks API

The goal

We are going to build, piece by piece, a complete REST API to manage one resource: tasks (a to-do). When you finish you will have assembled a realistic service out of small, testable functions, just like in a professional project.

The resource: a task

Each task is a simple object:

{ id: 1, title: "Study Node", done: false }

The REST routes

REST models the resource and uses the HTTP method for the action. For tasks:

Method Route Action
GET /tasks list (with optional filter)
GET /tasks/:id view one
POST /tasks create
PUT /tasks/:id update
DELETE /tasks/:id delete

Each operation responds with a coherent status code: 200 (OK), 201 (created), 400 (invalid input), 401 (not authenticated), 404 (not found).

Put this into practice

DevPath is a hands-on course: you read the theory here; in the app you put it into practice with exercises that really run, offline.

Start free in the app →
The layers: repository, validation and handlers →