Appendix C. Using JavaScript

Node.js is a JavaScript runtime that allows developers to write applications to run outside of the web browser. This has led to the growth of JavaScript libraries, helping developers write backend services. We can use tools to connect to databases and create APIs. Let’s get started.

C.1 Node Package Manager

NPM, or the Node Package Manager, is the central build and dependency management tool we’ll use for our API. We will use the Express library. First, make sure you have Node installed from https://nodejs.org/en/download/; then install the Express Generator application:

npm install express-generator -g
express hello-api

Once the code has been generated, edit the package.json file using the code in the following listing. ...

Get Shipping Go 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.