$ PORT = 4000 node app.js
bash: PORT: command not found
如上怎么解決
代碼如下:
var express = require('express');
var port = process.env.PORT || 3000;
var app = express();
app.set('views','./views');
app.set('view engine','jade');
app.listen(port);
console.log(port);
$ PORT = 4000 node app.js
bash: PORT: command not found
如上怎么解決
代碼如下:
var express = require('express');
var port = process.env.PORT || 3000;
var app = express();
app.set('views','./views');
app.set('view engine','jade');
app.listen(port);
console.log(port);
2017-02-13
這個是有個默認配置文件的環境端口,如果沒有就用3000端口啟動,
2019-04-07