Node+express Building personal website (1)

Source: Internet
Author: User
Tags install node

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.