1.Express is a simple and flexible node. JS WEB Application framework that provides a range of powerful features to help you create a variety of Web applications and rich HTTP tools.
Express can be used to quickly build a full-featured website.
2. So using the wxpress frame, you need to first install the Nodejs
3. Global Installation Express-generator
NPM Install Express--save-g
NPM Install Express-generator--save-g
Express is a web framework for NODEJS, which uses express to make it easier to use Nodejs.
Express-generator is the Express application generator, equivalent to express skeleton, into a Web project, using the Express ProjectName command, can quickly build projectname this application directory structure.
4. Start your first express project
Find the folder where you usually do your project. or feel free to find a place, open the file by command CD, or CMD at the path
At the path
Open after input command: Express project name, so create a new project
After installation there will be 3 selection:
Hit Item: CD Expressdemo
Installation: NPM Install
Startup Project: NPM start
To open a project using the editor
Bin: Used for app launch, can set the port number to start on the inside, etc.
/public: Static Resource Directory
/routes: Can be considered a controller directory, routing.
/views:jade template directory, which can be considered a view directory
App.js Program main file
Since the module is not yet in use, it is necessary to enter into the project and create the Node_modules.
Execute command
NPM Install Express
Generate Node_modules File
After the installation number to execute the command NPM start, will error, the prompt to find the corresponding module, this time according to the prompt installation can be
Execute command:
NPM I http-errors--save-g
Nodejs+express Building a server