March 2019
Intermediate to advanced
636 pages
27h 50m
English
We will implement an express (https://expressjs.com/) web application in Node.js to expose the preceding API. The code lies in the application folder in our repository, with the source code in app.js and the dependencies defined in package.json. As a prerequisite to running the web application, the dependencies must be installed either by running npm install or make (see Chapter 8, Agility In A blockchain network) within that folder.
The following code snippet shows how to instantiate and run the express server:
var express = require('express');var bodyParser = require('body-parser');var app = express();var port = process.env.PORT || 4000;app.options('*', cors());app.use(cors());app.use(bodyParser.json()); ...Read now
Unlock full access