因此,Node.js是在去年年底分叉的,而分叉版本是io.js。
我在文档上找不到任何安装指南。我是新来的,有人知道我如何可以使用快速web框架来设置io.js吗?谢谢!
发布于 2015-01-10 00:57:25
发布于 2015-01-10 01:15:50
执行答案1中的步骤,然后创建如下所示的index.js文件
var express = require('express');
var app = express();
app.use('/resources', express.static(__dirname + '/resources'));
app.get('*', function (req, res, next) {
res.send('hello world');
res.end();
});
app.listen(3000);和像这样的package.json文件
{
"name": "iojsexpress",
"version": "0.0.0",
"description": "Get express working with iojs",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.10.7"
}
}然后运行以下命令
npm install
iojs index.js在浏览器中访问localhost端口3000,您将看到"hello world“。
https://stackoverflow.com/questions/27871309
复制相似问题