使用node.js从Heroku启动Javascript应用程序时,无法在Facebook选项卡上发布错误

时间:2012-12-02 21:32:14

标签: facebook node.js heroku

我正在使用Heroku发布一个HTML5 / Javascript游戏,以显示在Facebook标签上。但是,在我的Facebook标签上,我收到以下错误:"无法发布/"。你可以在这里看到它的样子:https://www.facebook.com/MelviaGames/app_198159916987846

我的server.js看起来像这样:

var express = require('express'),
    server = express.createServer();

server.use('/cocos2d', express.static(__dirname + '/cocos2d') );
server.use('/cocosDenshion', express.static(__dirname + '/cocosDenshion') );
server.use('/classes', express.static(__dirname + '/classes') );
server.use('/resources', express.static(__dirname + '/resources') );

server.get('/', function(req,res){
    res.sendfile('index.html');
    console.log('Sent index.html');
});

server.get('/api/hello', function(req,res){
   res.send('Hello Cruel World');
});
app.post('/', function(request, response) {
  response.redirect('/');
});
server.listen(process.env.PORT || 3000);

我的heroku日志看起来像这样:

2012-12-02T10:58:08+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCClass.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=2ms service=4ms status=304 bytes=0
2012-12-02T10:58:09+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=3ms status=404 bytes=34
2012-12-02T10:58:09+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCCommon.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=14ms status=304 bytes=0
2012-12-02T10:58:09+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/platform.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=4ms service=4ms status=304 bytes=0
2012-12-02T10:58:09+00:00 heroku[router]: at=info method=GET path=/cocos2d/cocoa/CCGeometry.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=2ms service=4ms status=304 bytes=0
2012-12-02T10:58:10+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCTypes.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=1ms connect=2ms service=5ms status=304 bytes=0
2012-12-02T10:58:10+00:00 heroku[router]: at=info method=GET path=/cocos2d/cocoa/CCAffineTransform.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=5ms status=304 bytes=0
2012-12-02T10:58:11+00:00 heroku[router]: at=info method=GET path=/cocos2d/support/CCPointExtension.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=4ms service=6ms status=304 bytes=0
2012-12-02T10:58:11+00:00 heroku[router]: at=info method=GET path=/cocos2d/base_nodes/CCNode.js ho
st=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=3ms service=4ms status=304 bytes=0
2012-12-02T10:58:11+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCMacro.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=2ms service=4ms status=304 bytes=0
2012-12-02T10:58:12+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCConfig.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=3ms status=304 bytes=0
2012-12-02T10:58:12+00:00 heroku[router]: at=info method=GET path=/cocos2d/textures/CCTexture2D.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=2ms service=5ms status=304 bytes=0
2012-12-02T10:58:13+00:00 heroku[router]: at=info method=GET path=/cocos2d/textures/CCTextureCache.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T10:58:13+00:00 heroku[router]: at=info method=GET path=/cocos2d/actions/CCAction.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=9ms status=304 bytes=0
2012-12-02T10:58:13+00:00 heroku[router]: at=info method=GET path=/cocos2d/actions/CCActionInterval.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms se
rvice=3ms status=304 bytes=0
2012-12-02T10:58:14+00:00 heroku[router]: at=info method=GET path=/cocos2d/actions/CCActionManager.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=2ms service=8ms status=304 bytes=0
2012-12-02T10:58:14+00:00 heroku[router]: at=info method=GET path=/cocos2d/actions/CCActionEase.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T10:58:15+00:00 heroku[router]: at=info method=GET path=/cocos2d/layers_scenes_transitions_nodes/CCLayer.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=25ms service=4ms status=304 bytes=0
2012-12-02T10:58:16+00:00 heroku[router]: at=info method=GET path=/cocos2d/layers_scenes_transitions_nodes/CCTransition.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=2ms service=5ms status=304 bytes=0
2012-12-02T10:58:16+00:00 heroku[router]: at=info method=GET path=/cocos2d/sprite_nodes/CCSprite.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=3ms status=304 bytes=0
2012-12-02T10:58:16+00:00 heroku[router]: at=info method=GET path=/cocos2d/label_nodes/CCLabelTTF.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=2ms service=4ms status=304 bytes=0
2012-12-02T10:58:17+00:00 heroku[router]: at=info method=GET path=/cocos2d/text_input_node/CCIMEDispatcher.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=2ms service=4ms status=304 bytes=0
2012-12-02T10:58:17+00:00 heroku[router]: at=info method=GET path=/cocos2d/touch_dispatcher/CCTouchDelegateProtocol.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T10:58:17+00:00 heroku[router]: at=info method=GET path=/cocos2d/touch_dispatcher/CCTouchHandler.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=3ms status=304 bytes=0
2012-12-02T10:58:18+00:00 heroku[router]: at=info method=GET path=/cocos2d/touch_dispatcher/CCTouchDispatcher.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=3ms status=304 bytes=0
2012-12-02T10:58:18+00:00 heroku[router]: at=info method=GET path=/cocos2d/keypad_dispatcher/CCKeypadDispatcher.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T10:58:19+00:00 heroku[router]: at=info method=GET path=/cocos2d/CCDirector.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=3ms status=304 bytes=0
2012-12-02T10:58:19+00:00 heroku[router]: at=info method=GET path=/cocos2d/CCScheduler.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T10:58:20+00:00 heroku[router]: at=info method=GET path=/cocos2d/CCLoader.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=5ms status=304 bytes=0
2012-12-02T10:58:20+00:00 heroku[router]: at=info method=GET path=/cocos2d/platfor
m/CCApplication.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=6ms status=200 bytes=10927
2012-12-02T10:58:21+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCSAXParser.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=23ms status=200 bytes=7618
2012-12-02T10:58:24+00:00 heroku[router]: at=info method=GET path=/cocos2d/menu_nodes/CCMenu.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=39ms status=200 bytes=16592
2012-12-02T10:58:25+00:00 heroku[router]: at=info method=GET path=/cocosDenshion/SimpleAudioEngine.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=30ms status=200 bytes=15643
2012-12-02T10:58:26+00:00 heroku[router]: at=info method=GET path=/classes/AppDelegate.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=2ms service=11ms status=200 bytes=3058
2012-12-02T10:58:27+00:00 heroku[router]: at=info method=GET path=/api/hello host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=5ms status=200 bytes=17
2012-12-02T10:58:27+00:00 heroku[router]: at=info method=GET path=/resources/background.mp3 host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=53ms status=206 bytes=128313
2012-12-02T10:58:27+00:00 heroku[router]: at=info method=GET path=/resources/effect2.mp3 host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=7ms status=206 bytes=13407
2012-12-02T11:01:54+00:00 heroku[router]: at=info method=POST path=/ host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=3ms status=404 bytes=23
2012-12-02T11:09:28+00:00 app[web.1]: Sent index.html
2012-12-02T11:09:28+00:00 heroku[router]: at=info method=GET path=/ host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T11:09:28+00:00 heroku[router]: at=info method=GET path=/classes/cocos2d.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=2ms service=5ms status=304 bytes=0
2012-12-02T11:09:29+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCClass.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=9ms status=304 bytes=0
2012-12-02T11:09:29+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCCommon.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=3ms status=304 bytes=0
2012-12-02T11:09:29+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=5ms status=404 bytes=34
2012-12-02T11:09:29+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/platform.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=5ms status=304 bytes=0
2012-12-02T11:09:30+00:00 app[web.1]: Sent index.html
2012-12-02T11:09:31+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCCommon.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T11:09:31+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=3ms service=4ms status=404 bytes=34
2012-12-02T11:09:31+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/platform.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=3ms status=304 bytes=0
2012-12-02T11:09:32+00:00 heroku[router]: at=info method=GET path=/cocos2d/cocoa/CCSet.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=3ms status=304 bytes=0
2012-12-02T11:09:32+00:00 app[web.1]: Sent index.html
2012-12-02T11:09:32+00:00 heroku[router]: at=info method=GET path=/ host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=6ms status=304 bytes=0
2012-12-02T11:09:33+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCClass.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=3ms status=304 bytes=0
2012-12-02T11:09:33+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=3ms status=404 bytes=34
2012-12-02T11:09:33+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCCommon.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=5ms status=304 bytes=0
2012-12-02T11:09:33+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/platform.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T11:09:34+00:00 heroku[router]: at=info method=GET path=/cocos2d/cocoa/CCGeometry.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T11:09:34+00:00 heroku[router]: at=info method=GET path=/cocos2d/cocoa/CCSet.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=3ms service=5ms status=200 bytes=3699
2012-12-02T11:09:35+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCTypes.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=5ms status=304 bytes=0
2012-12-02T11:09:35+00:00 heroku[router]: at=info method=GET path=/cocos2d/cocoa/CCAffineTransform.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=3ms status=304 bytes=0
2012-12-02T11:09:35+00:00 heroku[router]: at=info method=GET path=/cocos2d/support/CCPointExtension.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=5ms status=304 bytes=0
2012-12-02T11:09:36+00:00 heroku[router]: at=info method=GET path=/cocos2d/base_nodes/CCNode.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=3ms status=304 bytes=0
2012-12-02T11:09:36+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCMacro.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T11:09:37+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCConfig.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=14ms service=4ms status=304 bytes=0
2012-12-02T11:09:37+00:00 heroku[router]: at=info method=GET path=/cocos2d/textures/CCTexture2D.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=5ms status=304 bytes=0
2012-12-02T11:09:37+00:00 heroku[router]: at=info method=GET path=/cocos2d/textures/CCTextureCache.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=2ms service=3ms status=304 bytes=0
2012-12-02T11:09:38+00:00 heroku[router]: at=info method=GET path=/cocos2d/actions/CCAction.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=2ms service=9ms status=304 bytes=0
2012-12-02T11:09:38+00:00 heroku[router]: at=info method=GET path=/cocos2d/actions/CCActionInterval.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=5ms status=304 bytes=0
2012-12-02T11:09:39+00:00 heroku[router]: at=info method=GET path=/cocos2d/layers_scenes_transitions_nodes/CCScene.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T11:09:40+00:00 heroku[router]: at=info method=GET path=/cocos2d/layers_scenes_transitions_nodes/CCLayer.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=2ms service=4ms status=304 bytes=0
2012-12-02T11:09:40+00:00 heroku[router]: at=info method=GET path=/cocos2d/layers_scenes_transitions_nodes/CCTransition.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=5ms status=304 bytes=0
2012-12-02T11:09:40+00:00 heroku[router]: at=info method=GET path=/cocos2d/sprite_nodes/CCSprite.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T11:09:41+00:00 heroku[router]: at=info method=GET path=/cocos2d/label_nodes/CCLabelTTF.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=8ms status=304 bytes=0
2012-12-02T11:09:41+00:00 heroku[router]: at=info method=GET path=/cocos2d/text_input_node/CCIMEDispatcher.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=3ms service=9ms status=304 bytes=0
2012-12-02T11:09:42+00:00 heroku[router]: at=info method=GET path=/cocos2d/touch_dispatcher/CCTouchHandler.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=2ms service=4ms status=304 bytes=0
2012-12-02T11:09:43+00:00 heroku[router]: at=info method=GET path=/cocos2d/keypad_dispatcher/CCKeypadDispatcher.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=6ms status=304 bytes=0
2012-12-02T11:09:44+00:00 heroku[router]: at=info method=GET path=/cocos2d/CCDirector.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=76ms status=304 bytes=0
2012-12-02T11:09:44+00:00 heroku[router]: at=info method=GET path=/cocos2d/CCScheduler.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=4ms service=65ms status=304 bytes=0
2012-12-02T11:09:45+00:00 heroku[router]: at=info method=GET path=/cocos2d/CCLoader.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=5ms status=304 bytes=0
2012-12-02T11:09:45+00:00 heroku[router]: at=info method=GET path=/cocos2d/CCDrawingPrimitives.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T11:09:45+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCApplication.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T11:09:46+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/CCSAXParser.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=6ms service=4ms status=304 bytes=0
2012-12-02T11:09:46+00:00 heroku[router]: at=info method=GET path=/cocos2d/platform/AppControl.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=5ms status=304 bytes=0
2012-12-02T11:09:47+00:00 heroku[router]: at=info method=GET path=/cocos2d/menu_nodes/CCMenuItem.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=5ms status=304 bytes=0
2012-12-02T11:09:47+00:00 heroku[router]: at=info method=GET path=/cocos2d/menu_nodes/CCMenu.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T11:09:47+00:00 heroku[router]: at=info method=GET path=/cocosDenshion/SimpleAudioEngine.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=6ms status=304 bytes=0
2012-12-02T11:09:48+00:00 heroku[router]: at=info method=GET path=/classes/AppDelegate.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=304 bytes=0
2012-12-02T11:09:48+00:00 heroku[router]: at=info method=GET path=/classes/MyFourthApp.js host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=5ms status=304 bytes=0
2012-12-02T11:09:48+00:00 heroku[router]: at=info method=GET path=/resources/background.mp3 host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=6ms service=4ms status=304 bytes=0
2012-12-02T11:09:49+00:00 heroku[router]: at=info method=GET path=/resources/effect2.mp3 host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=1ms connect=1ms service=7ms status=304 bytes=0
2012-12-02T11:09:48+00:00 heroku[router]: at=info method=GET path=/api/hello host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=3ms status=200 bytes=17
2012-12-02T11:10:12+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=stark-stream-2821.herokuapp.com fwd=115.64.155.218 dyno=web.1 queue=0 wait=0ms connect=1ms service=11ms status=404 bytes=34
2012-12-02T11:18:32+00:00 heroku[web.1]: Cycling
2012-12-02T11:18:35+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2012-12-02T11:18:37+00:00 heroku[web.1]: Process exited with status 1
2012-12-02T11:18:37+00:00 heroku[web.1]: State changed from up to down
2012-12-02T11:18:37+00:00 heroku[web.1]: State changed from down to starting
2012-12-02T11:18:38+00:00 heroku[web.1]: Starting process with command `node server.js`
2012-12-02T11:18:39+00:00 heroku[web.1]: State changed from starting to up
2012-12-02T12:01:34+00:00 heroku[router]: at=info method=POST path=/ host=stark-stream-2821.herokuapp.com fwd=123.243.50.82 dyno=web.1 queue=0 wait=0ms connect=34ms service=7ms status=404 bytes=23
2012-12-02T21:14:54+00:00 heroku[router]: at=info method=POST path=/ host=stark-stream-2821.herokuapp.com fwd=123.243.50.82 dyno=web.1 queue=0 wait=0ms connect=2ms service=6ms status=404 bytes=23

是否有人遇到同样的问题或知道如何解决? 感谢

2 个答案:

答案 0 :(得分:5)

如果您使用带有Node的express,则不推荐使用express.createservver,因此您应该如何使用它。在app.js或server.js中添加帖子调用可以解决问题。

var express = require('express');

var http = require('http');

var app = express();

app.set('port', process.env.PORT || 80);


//DEFINE ALL ROUTES
app.get('/', routes.dashboard.index);
app.post('/*', function(request, response) {
  response.redirect('/');
});

//SETUP HTTP LISTENER

server = http.createServer(app);

答案 1 :(得分:3)

自己找到答案,在server.js底部添加以下行

server.post('/*', function(req, res){

  res.sendfile('index.html');
});