Nodejs scaffolding to build express-based applications

 

Original link: https://www.cnblogs.com/FE-yanyi1993/p/6413042.html

This article is very detailed, and it is only recorded here.

 

1. Install the generator

$ npm install express-generator -g

 

 

2. Create an application named APP:

$ express app

 

3. Install dependency packages

$ cd app to enter the app directory

$ npm run install install dependencies

   Generate package.json file

 

4. Start the application

$ npm start

5. Use localhost:3000 to access in the browser

The default port is 3000

Change the port:

  Path: app/bin/www

  var port = normalizePort(process.env.PORT || '3000');

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324532664&siteId=291194637