This is the course’s first coding exercise, where you give the repair café’s shelf of spare parts an API of its own. If you haven’t solved a coding exercise on RealJS before, then this section shows you how the editor and its tests work before you start.
How Coding Exercises Work
A coding exercise runs right here in your browser, on Node 26. The editor above holds app.ts, the file you change. Click Run Tests or press Ctrl+Enter (Cmd+Enter on macOS), and automated tests check your code and mark each test as passed or failed.
In this exercise, the tests start your app themselves and call it with real HTTP requests, the way curl -i did in the lessons. They read each response’s status, headers, and body. So you don’t need to call app.listen() or run anything in a terminal.
The express your file imports is a smaller version of the package, with what the lessons have used so far, and ./parts.ts holds the shelf.
Run the tests early and often, even before you change anything. A failing test’s message tells you what it found and what it expected, so read it before you edit. Fix the first failing test, then run the tests again. A different failing test usually means you made progress!
Note: If every test fails with the same short error, then JavaScript couldn’t read your code. Check the line the message names and fix that first.
Getting stuck is normal. The Hints tab nudges you one step at a time, so see whether one hint is enough to get you going. Thinking it through yourself is where most of the learning happens. You can also ask your mentor about the exercise and your code at any time.
Tests marked Bonus are extra challenges. You’ve solved the exercise once the other tests pass.
For more room, click Full screen or press T while you’re not typing in the editor. When you’re done, open the Solution tab to compare your approach and read the notes.