RESTful APIs with Promises
One thing I really love about JavaScript is its extreme flexibility. In JavaScript there are seven different ways of doing anything, and you get to pick the one you like. This is especially true of managing asynchronous code.
Weâve already seen a number of approaches to working with asynchronous code in JavaScript. Early on, we used regular Node.js callbacks, and then talked about EventEmitters and streams. We explored the async module and its suite of asynchronous coding utilities, as well.
Now letâs turn to the RESTful APIs for editing book bundles. Here weâll talk about promisesâanother approach to managing asynchronous code.
Creating a Resource through POST with a Promise
The first thing weâll need for ...
Get Node.js 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.