1.express安装
npm install express
2.代码实现测试示例
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('Hello World!');
});
var server = app.listen(8081,function () {
var host = server.address().address;
var port = server.address().port;
console.log("express app listening at port:%s", port);
});
运行看效果:
学习参考 http://www.expressjs.com.cn