You’ve counted the lines you wrote by hand, and nearly half of them did the same work any server needs. Now Mrs. Okafor wants the board for real. The Hollybank committee meets next month, and she’d like to give them one address that answers the questions she’s been getting by phone all season.
In this project, you’ll build that board from her brief instead of following a lesson line by line. You’ll begin with a fresh copy of the starting project and bring over only the helpers you’ve already written. Then you’ll assemble the routes yourself, including one rule no lesson has built.
Read Mrs. Okafor’s Brief
A brief says what a program must do and leaves how to write it to you. Mrs. Okafor’s comes as a short note:
Members keep asking three things: which plots are free, how big a plot is, and how to get on the waiting list. People with big families want the bigger plots, so let them ask for a minimum size too. And please make sure nobody can read the waiting list. It has phone numbers on it.
Turned into endpoints, her note becomes this table. The board reads plots.json once when it starts, listens on port 3000, and appends each new entry to waitlist.jsonl:
| Request | Answer |
|---|---|
GET /plots |
200 and all 24 plots |
GET /plots?vacant=true |
200 and only the plots with no holder |
GET /plots?min_size=500 |
200 and only plots of at least 500 square feet |
GET /plots/7 |
200 and plot 7 |
GET /plots/99 or GET /plots/seven |
404, code plot_not_found |
| Any other path | 404, code not_found |
| A known path with a method it doesn’t take | 405 with an Allow header, code method_not_allowed |
POST /waitlist with a name and a contact |
201 and the stored entry |
POST /waitlist with broken JSON, or an empty body labeled application/json |
400, code invalid_json or empty_body |
POST /waitlist with a body over 1,024 bytes |
413, code body_too_large |
POST /waitlist without application/json |
415, code wrong_content_type |
The greeting at / isn’t in the table. It was only a first test, and it isn’t part of Mrs. Okafor’s brief, so the new board doesn’t need it and answers / with the not_found fallback.