Explain Your Ticket API

Dev’s ticket API is finished. The three exercises checked it from the outside, request by request, and every check passed. A passing test shows that the desk gets the right answers. It can’t show whether you know why your code gives them or whether you could change it safely when Dev asks for one more rule.

In this review, you’ll talk a mentor through your own API. You’ll explain what Express does for you, why each endpoint has its method and status code, and what keeps a ticket safe when two requests arrive at once or the app crashes mid-save. Then you’ll get a change request you haven’t seen and make it. Walking someone through your own code this way is a big part of the job for a full-stack developer.

Get Your API Ready

The mentor works from the code you wrote, so have your ticket-desk project open: routes/tickets.ts, store.ts, app.ts, and endpoints.md. You’ll paste them into the conversation when the mentor asks for them. Expect questions about how a save reaches the disk, so look over your store’s save() once more, including the writeFile() you know from Timers and Files and the rename() that follows it.

You’ll also need two terminals in the project folder, because you’ll implement the final change and test it with curl -i, as you did all through the course. The mentor’s requests assume you have the café’s five starting tickets. Stop the app if it’s running. If you want to keep your own tickets, save a copy of your tickets.json first. Then copy tickets.json from the course’s starting project and start the app with node --watch server.ts.

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.