Installing the Web Server
npm install connect
服务器配置文件 server.js
var connect = require('connect');
connect.createServer(
connect.static("angularjs/")
).listen(5000);
This simple file creates a basic web server that will respond to requests on port 5000 and serve up files contained
in a folder called angularjs, which is in Node.js installation folder.
in a folder called angularjs, which is in Node.js installation folder.
Starting the Web Server
To start the web server, run the following command from the Node.js installation directory:node server.js
This will load the server.js file and start listening for HTTP requests on port 5000