2

我正在使用 Heroku 启动 HTML5/Javascript 游戏以显示在 facebook 选项卡上。但是,在我的 facebook 标签上,我收到以下错误:“CANNOT POST/”。你可以在这里看到它的样子: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

有没有人有同样的问题或知道如何解决它?谢谢

4

2 回答 2

5

如果您在 Node 中使用 express,则 express.createservver 已被弃用,因此您应该使用它。在 app.js 或 server.js 中添加 post call 可以解决该问题。

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);
于 2014-01-15T22:59:55.237 回答
3

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

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

  res.sendfile('index.html');
});
于 2012-12-03T03:24:01.630 回答