Solution for Chapter 8: Building APIs

In Chapter 8, ​Building APIs​, the task was to use the design assets to implement a working API service using NodeJS and the DARRT library. The three key tasks are these:

  • Install the DARRT library into your NodeJS project.

  • Update your DARRT files (data, action, resources, representations, and transitions).

  • Once the API is completed, run a “happy path” validator script.

The instructions in the chapter also included a hint on how to initialize your NodeJS project using npm to update the project dependencies and start up the API service using nodemon.

Install the DARRT Library

The /before/ version of this exercise has the DARRT library already installed. I did that to copy a few hints into the script ...

Get Design and Build Great Web APIs now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.