Writing Modular Express Services
Throughout the remainder of the chapter, weâre going to build a RESTful web service with Express for creating and managing book bundles. These are basically named reading lists. Hereâs an example of a book bundle:
â | { |
â | â"name"â: â"light reading"â, |
â | â"books"â: [{ |
â | â"id"â: â"pg132"â, |
â | â"title"â: â"The Art of War"â |
â | },{ |
â | â"id"â: â"pg2680"â, |
â | â"title"â: â"Meditations"â, |
â | },{ |
â | â"id"â: â"pg6456"â, |
â | â"title"â: â"Public Opinion"â |
â | }] |
â | } |
The name field is a user-defined string to identify the list. Names do not have to be unique. The books field contains a list of the books in that bundle. Each book is identified ...
Get Node.js 8 the Right Way 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.