21
Heroku + node.js错误(Web进程在启动后60秒内未能绑定到$ PORT)
我有我的第一个node.js应用程序(在本地运行良好)-但是我无法通过heroku部署它(也是第一次使用heroku)。代码如下。因此,我不允许编写太多代码,所以我只想说在本地以及在我的网络中运行代码都没有问题。 var http = require('http'); var fs = require('fs'); var path = require('path'); http.createServer(function (request, response) { console.log('request starting for '); console.log(request); var filePath = '.' + request.url; if (filePath == './') filePath = './index.html'; console.log(filePath); var extname = path.extname(filePath); var contentType = 'text/html'; switch (extname) { case '.js': contentType …