A small, dependency-free REST API for managing tasks, built on Node's built-in http module.
It exists as a compact codebase for exercising pull-request workflows and automated code review.
- Node.js 20 or newer (no
npm installneeded — there are no dependencies)
npm start # listens on http://localhost:3000
PORT=8080 npm start # custom port
npm test # runs the test suite with node:test| Method | Path | Description |
|---|---|---|
| GET | /health |
Liveness check |
| GET | /tasks |
List tasks |
| POST | /tasks |
Create a task |
| GET | /tasks/:id |
Fetch one task |
| PATCH | /tasks/:id |
Update any subset of fields |
| DELETE | /tasks/:id |
Delete a task |
| Field | Type | Default | Notes |
|---|---|---|---|
title |
string | required | 1–200 characters, trimmed |
status |
todo | doing | done |
todo |
|
priority |
integer 1–3 | 2 |
1 is highest |
dueDate |
YYYY-MM-DD string or null |
null |
must be a real calendar date |
tags |
array of up to 10 strings | [] |
lower-cased and de-duplicated |
curl -X POST localhost:3000/tasks \
-H 'Content-Type: application/json' \
-d '{"title":"Write release notes","priority":1,"tags":["docs"]}'Validation failures return 400 with a details object keyed by field name.
src/
index.js process entry point
server.js HTTP routing and error mapping
store.js in-memory task storage
validate.js request validation
test/ node:test suites