javascript - How to run Express on io.js - Stack Overflow

So Node.js was forked late last year and the forked version is io.js.I can't find anything of a se

So Node.js was forked late last year and the forked version is io.js.

I can't find anything of a setup guide on the docs. I'm fairly new, anyone know how I can setup io.js using Express web framework? Thanks!

So Node.js was forked late last year and the forked version is io.js.

I can't find anything of a setup guide on the docs. I'm fairly new, anyone know how I can setup io.js using Express web framework? Thanks!

Share asked Jan 10, 2015 at 0:08 pourmesomecodepourmesomecode 4,36812 gold badges53 silver badges91 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 6

Do the steps in answer 1, then create an index.js file like this

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);

and a package.json file like this

{
  "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"
  }
}

and then run the following mands

npm install
iojs index.js

and visit localhost port 3000 in your browser and you should see "hello world"

Actually io.js wasn't released yet. First release will be at January 13th(or 14rth) (see here). At this time the best you can do to setup io.js is to clone its repository:

git clone https://github./iojs/io.js

and try to build it manually. On Unix/Max it looks like:

./configure
make
make install

But I do not remend you to do this. Beware: now very active preparation for the first release is going on. Lots of mits with possibly breaking changes. So better wait less then one week until first official io.js version will be released.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744913641a4600700.html

相关推荐

  • javascript - How to run Express on io.js - Stack Overflow

    So Node.js was forked late last year and the forked version is io.js.I can't find anything of a se

    1天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信