VS Code Intermediate Creation
1. Settings.json
{"Git.ignorelimitwarning":true}
2.
1. NPM Init installs Pageage.json 2. NPM Install Jqurey Bootstrap 3. Install NPM install-g cnpm--registry=https://registry.npm.taobao.org4. Node HTTP service 1. Require (' HTTP ')//introduced 2. Create HTTP Service 3. Receives the Send response request HTTP. Createserver response.writehead (200,{' content-type ': ' Text/plain '})//Request header content-type:text/html//with HTM L returnText/plain//Return as-isText/joinText/xml
3.
//1. Require (' http ')varhttp= require(' http ')varPort= 8000 //2. Creating an HTTP service from an HTTP modulevarNodeserver=http.Createserver(function(Request,Response) {//Send HTTP header //HTTP Status value: 200 (Success) 400 500 401 402 403 ... 502 errors on the service sideResponse.Writehead( $, {' Content-type ':' Text/plain;charset=utf-8 '})//content is Text/plain //Send the response data to the clientResponse.End(' Hello first Nodejs ')}) Nodeserver.Listen(Port,' localhost ',function(Err) {if(ERR)ThrowErr//Service creation failed, burst error Console.Log(' Service created successfully! ')})
4. Start
PS d:\nodejs\node-master\http> Node Index01.js service created successfully!
5. Http://localhost:8000/
Note If there is a garbled
Pasting
Response.Writehead( $, {' Content-type ':' Text/plain;charset=utf-8 '})
Start the Nodejs service