Node.js is a Javascript running environment (runtime). In fact, it encapsulates the Google V8 engine. The V8 engine executes Javascript very quickly and has very good performance. Node.js optimizes some special use cases and provides an alternative API to make V8 run better in non-browser environments. Node.js is a platform based on the Chrome JavaScript runtime, which is used to easily build fast response and easy to expand network applications. Node.js uses event-driven, non-blocking I/O models for lightweight and efficient, making it ideal for data-intensive real-time applications running on distributed devices.
Express is a minimalist and flexible web application development framework based on the Node.js platform. It provides a series of powerful features to help you create a variety of web and mobile applications. Express is also the officially recommended web framework.
Here is a description of how to run a website in the window environment:
1 Install node.js
2 Create a new folder nodejs_express
3 Open cmd and locate it under nodejs_express
The code copy is as follows:
E:/myapp/nodejs_express
4 The project initializes npm init. After completing the configuration, a file will be generated in the folder:
package.json
5 Install Express:npm install express. After the installation is successful, a node_modules directory will be generated in the folder.
6 Express project initialization express (express hello)
7 Install dependency package npm install serve-favicon morgan cookie-parser body-parser path;>npm install jade
Even simpler is:
Enter the project directory and install the nodejs dependency module npm install (cd hello; npm install)
8 Start npm start and access it using the 3000 port of the local IP
9 The port number can be modified in the bin/www file
The above is the relevant knowledge of the Node.js+Express configuration introductory tutorial introduced to you by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to Wulin.com website!