
WikiFree learning path 36 · Intermediate
The API dispatch
A useful endpoint has a contract and a failure path.
Build and test a local Node.js JSON API for a small in-memory task list, including validation and predictable HTTP responses.

Video duration uses the selected lessons only. Reading and practice times are planning estimates; repeat difficult work as needed.
A clear starting point
Who this is for
JavaScript functions, arrays, objects and basic async concepts. Complete the JavaScript path first if needed.
Your practical result
Build and test a local Node.js JSON API for a small in-memory task list, including validation and predictable HTTP responses.
This does not include authentication, a database, deployment or production hardening. Express concepts in the provider course are adapted to the dependency-free reference.
Access and cost
Public videos and Node.js are free. The reference uses built-in modules and runs locally; no hosting, paid API or cloud account is required.
The project pack contains an original workbook, case inputs, an evidence log and reference notes. Some technical paths include starter code and a runnable reference. Read the pack README before starting.
Three-minute readiness check
Answer first, then open each explanation. A missed answer identifies what to revisit; it does not stop you from starting.
Is an HTTP 200 appropriate for every outcome?
No. The status should reflect the result.
Does JSON parsing validate the business rules?
No.
Will an in-memory list survive a restart?
No.
The case you will work on
The fictional Spruce Workshop needs a local task API. Each task has a numeric ID, a nonblank title of at most 80 characters and a done flag. Data is deliberately held in memory and disappears when the process restarts; this is a learning server, not a deployed service.
| Request | Expected behavior |
|---|---|
| GET /tasks | 200 and a JSON array |
| POST /tasks with valid title | 201 and the created task |
| POST /tasks with blank title | 400 and an error |
| GET /missing | 404 |
| Malformed JSON body | 400 |
These are supplied synthetic inputs, not observations from a real organization. Label assumptions and any additional data you create.
Keep an evidence trail
Save each stage output in the project folder. In evidence_log.csv, record the decision, the artifact or test that supports it, what failed, and the revision you made.
Your route from learning to evidence
- Stage 1Set up a local runtimeA reproducible local project and run note.60 minutes of original practice
- Stage 2Define routes and response contractsA two-route API and response contract.85 minutes of original practice
- Stage 3Validate incoming dataValidated creation with predictable errors.90 minutes of original practice
- Stage 4Add an update and test failuresA tested update route and failure log.95 minutes of original practice
- Stage 5Document the API and its limitsA local API package with contract tests and limitations.60 minutes of original practice
- Final projectMake the evidence reviewableConnect the five stage outputs and test a change.240 minutes estimated
Progress stays in this browser. Tick a stage only after its evidence check passes. This is a personal checklist, not a certificate.
Why these source courses
The path uses selected material from courses already published on WikiFree. The original exercises below connect that material to one practical outcome. Follow only the listed assignments; completing the full source courses is optional.
Microsoft
Free Node.js Course: Learn Server-Side JavaScript
Microsoft Node lessons supply runtime, npm, API routing, JSON, updates and debugging concepts. The small built-in HTTP server and its tests are original WikiFree practice.
Access: Free Video
Certificate: Video viewing only; no certification exam or certificate promised
Learn it, apply it, check it
Work in order. Every stage produces something the next stage uses. Revisit the repair instruction when a check fails.
Set up a local runtime
JavaScript functions, arrays, objects and basic async concepts. Complete the JavaScript path first if needed.
The idea to use
Node.js runs JavaScript outside the browser. Start with a small project and a documented run command. The supplied reference uses the built-in HTTP module to keep dependencies minimal; provider videos also introduce npm and later demonstrate Express. Both approaches involve requests and responses, but their routing code is different. Bind the practice server to localhost only.
Watch the selected lessons
- 1. What is Node.js and why you should learn it2:30
- 4. How to run JavaScript code in Node.js using files or REPL2:19
- 6. How to create a new Node.js project3:36
- 7. How to use NPM scripts for your development task automation2:17
Selected video time: 11m. Open this course on WikiFree.
Your 60-minute lab
Create the project folder, inspect the supplied package file and run the local health endpoint. Record your Node version.
Save: A reproducible local project and run note..
Evidence check
The server listens on 127.0.0.1 and returns the documented health response.
If it fails: Do not expose this unauthenticated teaching server on a public interface.
Define routes and response contracts
Bring your previous output: A reproducible local project and run note.
The idea to use
A route combines method and path. Define the success body and likely failure responses before implementing it. GET /tasks reads; POST /tasks creates. A JSON response needs a matching content type and valid serialization. Keep route handling separate from task validation so tests can isolate each behavior.
Watch the selected lessons
- 17. How to create a web API with Node.js and Express4:27
- 18. How to create a GET API with Node.js and Express4:36
- 19. How to handle API routing with Node.js and Express3:51
Selected video time: 13m. Open this course on WikiFree.
Your 85-minute lab
Write a route table, then implement list and create handlers using the supplied scaffold.
Save: A two-route API and response contract..
Evidence check
List returns an array with 200; successful creation returns the new task with 201.
If it fails: Do not return an HTML error page while advertising application/json.
Validate incoming data
Bring your previous output: A two-route API and response contract.
The idea to use
Treat request bodies as untrusted input. Limit the accepted body size, catch malformed JSON and validate title type and length. A valid JSON object can still contain an empty title or the wrong type. Reject unsupported fields or ignore them according to an explicit contract; never let a client choose internal IDs by accident.
Watch the selected lessons
Selected video time: 5m. Open this course on WikiFree.
Your 90-minute lab
Implement title validation and a small request-body limit. Test blank, numeric, oversized and malformed inputs.
Save: Validated creation with predictable errors..
Evidence check
Invalid requests create no task and receive the documented 400 or size-limit response.
If it fails: Check the list after a rejected request to prove no partial record was added.
Add an update and test failures
Bring your previous output: Validated creation with predictable errors.
The idea to use
An update needs an existing ID and an allowed field. For this project, PATCH /tasks/:id accepts only a boolean done value. Missing tasks return 404, malformed updates return 400 and unsupported methods return a documented error. Debug with a reproducible request and a useful log message rather than changing several branches at once.
Watch the selected lessons
- 21. How to create update and delete APIs with Node.js and Express4:50
- 22. How to run your code step by step in Node.js built-in debugger5:58
- 25. How to read a stack trace in VS Code to debug a Node.js app3:37
Selected video time: 14m. Open this course on WikiFree.
Your 95-minute lab
Implement the done update and run requests for an existing ID, missing ID and invalid boolean.
Save: A tested update route and failure log..
Evidence check
Only the addressed task changes, and invalid updates preserve the previous state.
If it fails: Do not treat the string false as the boolean false through generic truthiness.
Document the API and its limits
Bring your previous output: A tested update route and failure log.
The idea to use
A handover should include install/run steps, routes, example requests and known limits. A lockfile matters when dependencies are used; the reference avoids third-party packages. The local server has no authentication, durable storage or production rate limiting. State these limits clearly so a working demo is not mistaken for a service ready to hold real user data.
Watch the selected lessons
Selected video time: 4m. Open this course on WikiFree.
Your 60-minute lab
Write the README and run the provided HTTP smoke checks from a fresh process. Verify that restart clears the list as documented.
Save: A local API package with contract tests and limitations..
Evidence check
A reviewer can reproduce success, rejection, missing-resource and restart behavior.
If it fails: Do not claim persistence or deployment when the project uses only process memory.
A worked reference to compare
Creating a task returns 201 and a generated ID. A blank title returns 400 and leaves the list unchanged. Updating an unknown ID returns 404. Restarting the process resets the teaching data; that behavior is an explicit limitation.
Compare your reasoning as well as the result. If your answer differs, state the assumption or input that explains the difference. Reference notes are for checking after an attempt; copying them is not evidence of independent work.
Your final project
Your brief
Deliver the server, run instructions, route contract, request examples and test results. Add a maximum-title boundary test at 80 and 81 characters and show that failed creation leaves the task count unchanged.
Time box: 4h 00m estimated. Extend it if a gate needs repair.
Hand in these artifacts
- A reproducible local project and run note.
- A two-route API and response contract.
- Validated creation with predictable errors.
- A tested update route and failure log.
- A local API package with contract tests and limitations.
- A short README: outcome, how to inspect or run the work, assumptions and limitations.
- A before-and-after change test and the completed evidence log.
Run a final review
- Use the supplied reference to reconcile the baseline result.
- Choose one relevant input or constraint to change. Write your expected effect before testing it.
- Run the calculation, walkthrough or test again and save the actual result.
- Ask a peer to inspect the evidence, or perform a separate self-review. Label which review you used.
- Score the work using the rubric and repair every critical failure.
Review rubric · 100 points
| Criterion | Points | Evidence to inspect |
|---|---|---|
| Practical outcome and case reasoning | 25 | Build and test a local Node.js JSON API for a small in-memory task list, including validation and predictable HTTP responses. |
| Five stage checks | 30 | Award 6 points for each stage only when its stated gate is demonstrably met. |
| Traceable evidence | 20 | Artifacts, inputs and calculations or tests are reproducible; synthetic and simulated evidence is labelled. |
| Revision after a changed condition | 15 | Change one input or constraint, predict the effect, test it and record the result. |
| Handoff quality | 10 | A reviewer can find the files, follow the instructions and understand the remaining limitations. |
Completion target: at least 80/100, all five stage gates passed, and every critical issue below corrected. This is a learning benchmark, not an accredited qualification.
Critical issue: Rejected requests cannot change state, and the API is clearly identified as a local in-memory demo.
Before you go further
What will I be able to produce?
Build and test a local Node.js JSON API for a small in-memory task list, including validation and predictable HTTP responses.
Is the whole path free?
Public videos and Node.js are free. The reference uses built-in modules and runs locally; no hosting, paid API or cloud account is required.
Do I need to finish every source course?
No. Follow the selected assignments at each stage. Source courses provide context, while the original case, labs and final review build the practical result. Extra study is optional.
What counts as completion?
Complete all five stage checks, earn at least 80/100 on the final rubric and correct every critical issue. This does not include authentication, a database, deployment or production hardening. Express concepts in the provider course are adapted to the dependency-free reference.
Questions & discussion
Share a useful question or correction. Comments appear after moderation. Please avoid personal or sensitive information.