我已经编写了一个基本的node.js应用程序,并且我已经设法在Heroku上部署它而没有任何问题.我已经创建了我的package.json和Procfile,但是从日志中我看到没有正在运行的进程,因此无法获得任何响应.可能是什么问题呢?
PS:我不想使用Express框架
我的代码:
var http = require("http");
http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
console.log("I am working");
}).listen(8888);
Run Code Online (Sandbox Code Playgroud)
我的package.json:
{
"name": "node-example",
"version": "0.0.1",
"dependencies": {
},
"engines": {
"node": "0.8.x",
"npm": "1.1.x"
}
}
Run Code Online (Sandbox Code Playgroud)
日志:
2012-10-22T12:36:58+00:00 heroku[slugc]: Slug compilation started
2012-10-22T12:37:07+00:00 heroku[slugc]: Slug compilation finished
2012-10-22T12:40:55+00:00 heroku[router]: Error H14 (No web processes running) -> GET aqueous-bastion-6914.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
2012-10-22T12:50:44+00:00 heroku[router]: Error H14 (No web processes running) …Run Code Online (Sandbox Code Playgroud) 情况是
我从这里克隆了OpenShift-V3的Django代码。当我使用python manage.py runserver出现错误的方式运行代码时,
django.core.exceptions.ImproperlyConfigured:无法加载WSGI应用程序'application';导入模块时出错:“应用程序看起来不像模块路径
我没有在代码中添加任何内容,所需的软件包已经满足。
我认为问题是我使用的是SQLite3,所以我迁移到了PostgreSQL,但问题仍然存在.该应用程序在本地工作正常 我用heroku打开我的应用程序,它给了我以下错误:
Application Error. An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the application owner, check your logs for details..
Run Code Online (Sandbox Code Playgroud)
我试图通过查看日志找到解决方案但失败了,所以我需要别人的帮助.这是我的日志,我感谢任何帮助!
2012-11-19T00:55:37+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e production -p 3545`
2012-11-19T00:55:39+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them …Run Code Online (Sandbox Code Playgroud)