concept book api in category aurelia
appears as: book API, books API

This is an excerpt from Manning's book Aurelia in Action.
In this step, you’ll enhance the book API, adding a method to save books. For now, this method will simulate saving to a backend store by creating and resolving a promise to add an artificial element of latency. (In chapter 8, you’ll modify this function to save the book into a MongoDB database using the aurelia-fetch-client module.) Edit the ./services/book-api.js file to add a new saveBook method.
1. Modify the book API to return hardcoded genre and shelf arrays.