nodejs相关

来源:互联网 发布:域名交易网站有哪些 编辑:程序博客网 时间:2024/06/05 07:30

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.


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

Load the Test File

URL    http://localhost:5000/test.html
0 0
原创粉丝点击