January 2018
Intermediate to advanced
336 pages
7h 22m
English
In this section, you’ll develop a minimal Hello World application using Express to cover the basics, then we’ll move on to something more substantial. Since this project will be short-lived, we won’t bother with creating a package.json file.
To begin, create a directory called hello to hold the application, and open a terminal to this directory. Next, install Express and Morgan (a logging utility).
| | $ npm install express@4.14.1 morgan@1.8.1 |
With those modules installed, open a text editor and enter the following:
| | 'use strict'; |
| | const express = require('express'); |
| | const morgan = require('morgan'); |
| | |
| | const app = express(); |
| | |
| | app.use(morgan('dev')); |
| | |
| | app. ... |
Read now
Unlock full access