Create a Note

Decide what you would build from the brief alone. Everything below it is available, but the exercise stops working if you open it first.

The brief you were given

Add POST /notes. It takes a title and a body, stores the note, and returns it with its id. Return the right status code and set the Location header.

The trap — the wrong fix that looks right

Returning 200 with the created object and no Location header, because the test passes and the frontend works. It works because this frontend reads the id out of the body. The next client — a script, a mobile app, another service — has no way to learn the resource's address except by convention, and any caller that got a network error now has no way to find out whether its note was created.