Angularjs How to build a Web server? Angularjs detailed procedures for building a Web server

Source: Internet
Author: User
Tags install node node server

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.

Related Article

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.