Node.js is a JavaScript runtime environment (runtime). It actually encapsulates the Google V8 engine. The V8 engine executes JavaScript very quickly and performs very well. Node.js is optimized for special use cases, providing an alternative API that makes V8 run better in a browser-less environment. Node.js is a platform based on the chrome JavaScript runtime that is used to easily build network applications that respond quickly and easily. Node.js uses event-driven, non-blocking I/O models to be lightweight and efficient, and is ideal for data-intensive, real-time applications running on distributed devices.
Express is a minimalist, flexible Web application Development framework based on the Node.js platform that provides a wide range of features to help you create Web and mobile device applications. Express is also the official recommended web framework.
Here's how to run a Web site in window environment:
1 Installation Node.js
2 Create a new folder Nodejs_express
3 Open cmd, position to nodejs_express
Copy Code code as follows:
4 Project Initialization NPM Init, after the configuration, will generate a file under the folder:
Package.json
5 Install EXPRESS:NPM Install Express, after the installation is successful, will create a node_modules directory under the folder
6 Express Project Initialization Express (express Hello)
7 Install Dependency pack NPM install Serve-favicon Morgan cookie-parser body-parser path;>npm Install Jade
It is simpler to:
Enter the project directory, install the Nodejs dependency module NPM install (CD hello; NPM install)
8 start NPM start and access with 3000 ports on the local IP
The 9 port number can be modified in the Bin/www file
The above is a small set to introduce the node.js+express configuration of the relevant knowledge of the tutorial, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!