My personal website http://yangchaojie.top/
First Look at node
node. JS is a JAVASCRIPT runtime environment based on the Chrome V8 engine.
node. JS uses an event-driven, non-blocking I/O model to make it lightweight and efficient.
node. JS's Package Manager, NPM, is the world's largest open source library ecosystem.
Excerpt from (http://nodejs.cn/)
The following is a personal understanding
First Node A JavaScript runtime environment, analogy Java JRE Java Runtime Environment, with node we can let the Javscript code not only run on the browser, but also can run on node, As long as the installed node environment is able to run JavaScript code,
Then node is the model of event-driven, non-blocking I/O, when the request arrives, node does not block the reading of the local file and continues to accept subsequent requests, when the read local file completes the operation after continuing to read the file, which is the JavaScript unique feature, the event callback
Find out more about Express
Express is a fast, open, minimalist web development framework based on the node. JS platform.
Web Apps
Express is a minimalist, flexible Web application Development framework based on the node. JS platform that provides a range of powerful features to help you create a wide variety of web and mobile device applications.
Excerpt from (http://www.expressjs.com.cn/)
Express can be used to quickly build a Web application without the need to write cumbersome HTTP modules
Install node
http://nodejs.cn/download/Download and install
Install Express
NPM Install Express--save
Detailed installation website is written in detail
Http://www.expressjs.com.cn/starter/installing.html
After installation is complete
Create a App.js file
var express = require (' Express '); var app = Express (); App.get (function (req, res) { res.send (' Hello world! ') );}); var function () { var host = server.address (). Address; var port = server.address (). Port; Console.log (' Example app listening at http://%s:%s ', host, Port);});
Node App.js//Start server
Open Browser Http://localhost:3000/
You can see a webpage HelloWorld
Node+express Building personal website (1)