3
我在Heroku上運行Node.js/Express/MongoHQ應用程序。它在當地完美運作。當我推送到Heroku時,根頁面「/」會正確加載,並且可以成功訪問MongoHQ數據庫。每一條其他路由都會給我一個內部服務器錯誤,並且Heroku日誌中沒有可識別的錯誤。雖然如果我去/頁/我確實得到我的應用程序的500頁來正確呈現(隨機...)Heroku/Node.js - 導致內部服務器錯誤的某種路由錯誤
有什麼你可以想到的,這可能會出錯在這裏?我認爲這是一個數據庫的東西,但現在它看起來像一個路由的事情。我很高興提供任何代碼......我認爲我會粘貼一些日誌,儘管對我來說這對我來說是超級無用的。任何想法MAJORYL讚賞。
謝謝。
日誌(用於基本上比其他任何路線「/」)
2011-10-07T17:27:03+00:00 app[web.1]: 10.94.69.43 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /assets_js/lib/jquery.1.4.2.min.js HTTP/1.1" 304 - "<MYSITE>/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/assets_js/lib/jquery.timeago.js dyno=web.1 queue=0 wait=0ms service=5ms status=304 bytes=0
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/assets_js/lib/jquery.1.4.2.min.js dyno=web.1 queue=0 wait=0ms service=7ms status=304 bytes=0
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/assets_js/lib/iscroll.js dyno=web.1 queue=0 wait=0ms service=3ms status=304 bytes=0
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/assets_css/viewer.css dyno=web.1 queue=0 wait=0ms service=3ms status=304 bytes=0
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/assets_js/utils.js dyno=web.1 queue=0 wait=0ms service=2ms status=304 bytes=0
2011-10-07T17:27:03+00:00 app[web.1]: 10.117.9.191 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /assets_js/lib/iscroll.js HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:03+00:00 app[web.1]: 10.117.11.66 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /assets_css/viewer.css HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/assets_js/mediacreate.js dyno=web.1 queue=0 wait=0ms service=2ms status=304 bytes=0
2011-10-07T17:27:03+00:00 app[web.1]: 10.94.74.117 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /assets_js/mediacreate.js HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/view_dashboard/activecard.js dyno=web.1 queue=0 wait=0ms service=3ms status=304 bytes=0
2011-10-07T17:27:03+00:00 app[web.1]: 10.84.93.33 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /view_dashboard/activecard.js HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/view_dashboard/drawon.js dyno=web.1 queue=0 wait=0ms service=3ms status=304 bytes=0
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/assets_css/dashboard.css dyno=web.1 queue=0 wait=0ms service=3ms status=304 bytes=0
2011-10-07T17:27:03+00:00 app[web.1]: 10.64.155.131 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /view_dashboard/dashboard.js HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/view_presentation/cards/cards.js dyno=web.1 queue=0 wait=0ms service=8ms status=304 bytes=0
2011-10-07T17:27:03+00:00 app[web.1]: 10.84.95.29 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /view_presentation/cards/cards.js HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:03+00:00 app[web.1]: 10.64.155.131 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /view_presentation/cards/cards.css HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:05+00:00 app[web.1]: 10.64.147.7 - - [Fri, 07 Oct 2011 17:27:05 GMT] "GET /assets_img/graph.gif HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:05+00:00 heroku[router]: <MYSITE>/assets_img/graph.gif dyno=web.1 queue=0 wait=0ms service=6ms status=304 bytes=0
2011-10-07T17:27:05+00:00 app[web.1]: 10.84.95.29 - - [Fri, 07 Oct 2011 17:27:05 GMT] "GET /favicon.ico HTTP/1.1" 500 1682 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:05+00:00 heroku[router]: GET <MYSITE>/favicon.ico dyno=web.1 queue=0 wait=0ms service=5ms status=500 bytes=1682
它看起來像你的靜態文件配置錯誤。你可以發佈你的快速配置的一部分?應該看起來像'app.use(express ['static'](__ dirname +'/ public',{maxAge:86400000}));'如果您使用樣板模板。 –
好酷,我希望你在這裏的東西。這是我目前的靜態目錄'app.use(express.static(__ dirname +'/ public'));'然後我有5個文件夾在「assets_css,assets_js等......」。我不完全確信可能的唯一原因是,當我轉到'/'時,它確實會將所有這些文件正確地拉入。 – tuddy
這個問題似乎是在你的路由定義或server.js定義(如何處理favicon.ico)。 你能發佈那些嗎? – theprogrammer