Explain Your Request Line

Your request line now passes both graded exercises. It takes Gloria’s requests, refuses a second request from the same listener and the songs the station won’t air, and marks a request played. However, those exercises ran your slices inside an app they supplied. They never saw your own tests, your reference, or your log, and they can’t tell whether you could change the API safely when Gloria asks for one more rule.

In this review, you’ll show the mentor evidence from your own project and explain how one request travels through your code. Then you’ll make a change you haven’t seen.

Get Your Evidence Ready

The mentor can’t see your files or your terminal, so it works only from what you paste into the conversation. Open your local request line project with two terminals in its folder. When the mentor asks for a code file, such as your requests router or your data functions, paste it as it is. Along the way, the mentor asks for three pieces of evidence:

  1. Your tests and their output: Your requests test file and the helper that sets up and cleans up each test’s data, then the whole output of npm test. The code shows what each test sends and checks, and the output shows whether they pass.
  2. One documented example beside the real answer: An example from docs/api.md as you wrote it, then the output of the same curl -i call sent to your running API.
  3. The headers and the log line: The headers your API sends back for a request with a phone number in its URL, and the line it prints for that request.

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.