Raj*_*war 1 javascript get node.js express cloud9-ide
服务器启动没有任何错误,但URL显示没有应用程序运行.
我的代码:
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');
Run Code Online (Sandbox Code Playgroud)
您实际上没有将服务器设置为侦听端口.更换
console.log('server started');
Run Code Online (Sandbox Code Playgroud)
同
app.listen(3000, function() {
console.log('server started');
});
Run Code Online (Sandbox Code Playgroud)
请注意,使用上面的示例,绑定端口为3000.有关详细信息,请参阅API文档
| 归档时间: |
|
| 查看次数: |
125 次 |
| 最近记录: |