服务器启动时没有任何错误,但URL被击中,显示没有应用程序正在运行。基本Node.js代码不起作用
我的代码:
var express= require('express');
var app=express();
app.get('/', function(req, res, next) {
console.log('home');
res.send(200);
res.end('getting requests');
});
console.log('server started');
这是您的整个代码?如果是这样,你还没有调用'app.listen(port);' – 2014-09-02 09:22:25