Build your own service framework with local nodejs+express

Using the Express framework in nodejs can easily generate an application framework, and creating an application through the Express application is just one of many methods. They are all open source frameworks, and you can modify it to meet your needs.
1. Express creates the default project
1.1, installs express-generator
1.2 globally , creates an app application
1.3 in the current working directory , starts the service
command line input, npm install express-generator -g, install express-generator globally (-g) express-generator . Enter, express -h, -h option can list all available command line options:

 

1.2. Create an app in the current working directory

Enter, express myapp, and create an application named myapp in the current directory. The directory structure is as follows:

Execute according to the prompts, cd myappp, and then npm install to install dependent packages

So red these files

1.3, start the service

Enter, npm start, you can start the service,

This can start the node website normally:

Guess you like

Origin blog.csdn.net/youyouxiong/article/details/104875774