为什么express一启动就结束
express版本是4的
app.js var express = require(‘express’); var route = require(’./route’); var app = express();
app.set(‘views’, ‘./views’); app.set(‘view engine’, ‘jade’); app.set(‘port’, 8080);
route.initialize(app)
console.log(‘Listening on port 8080’);
route.js module.exports.initialize = function(app) {
app.get("/", function(req, res) {
res.send("hello world!");
});
};
新手入门 求指导
2 回复
因为没有执行 app.listen(port)
thx… 傻逼了…