This article mainly introduces about ANGULARJS start the Web server operation, hope to help everyone, now read the article
Install node. js
Download link
Website address: https://nodejs.org/en/
I am under the decompression version, directly extracted to the directory you want to install
On my Computer (right-click) → properties → advanced system variables → environment variables
Writing Node_path
Add to Path
Node-v
The node version can be displayed in the console
v6.11.4
Installing the Web server
NPM Install CONNECTNPM Install serve-static
Write the Server.js file, the book version is 2.x version, is now a 3.x version, the book Code is invalid, put the file in the Nodejs installation directory
var connect = require (' Connect '); Servestatic = require (' serve-static '); var app = connect (); App.use (Servestatic (". /angularjs ")); App.listen (5000);
Angularjs settings
New Angularjs folder and Nodejs installation directory peer
You need to prepare bootstrap CSS files and angular.js in the folder
Angularjs folder Download address: Click to download
New firsttest.html under Angularjs folder
<! DOCTYPE html>
Start the Web server
Jump to Nodejs's installation directory
Node Server.js
View Browser http://localhost:5000/FirstTest.html
The effect is as follows:
This is the end of this article (want to see more on the Topic.alibabacloud.comAngularJS User manual section of the study), there are questions can be in the message below the question.