Express over CloudFoundryで静的ファイルを提供するにはどうすればよいですか?私は次のコードを使おうとしていました:
app.use(express.static(__dirname+'/www'));
しかし、特定のURLにアクセスしているときに、奇妙な例外が発生します。
TypeError: Object #<SendStream> has no method 'on'
at Object.static [as handle] (/var/vcap/data/dea/apps/FeedBack-0-c812c99aa3818946dd0bcf5538e2aecd/app/node_modules/express/node_modules/connect/lib/middleware/static.js:75:8)
at next (/var/vcap/data/dea/apps/FeedBack-0-c812c99aa3818946dd0bcf5538e2aecd/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Object.expressInit [as handle] (/var/vcap/data/dea/apps/FeedBack-0-c812c99aa3818946dd0bcf5538e2aecd/app/node_modules/express/lib/middleware.js:31:5)
at next (/var/vcap/data/dea/apps/FeedBack-0-c812c99aa3818946dd0bcf5538e2aecd/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Object.query [as handle] (/var/vcap/data/dea/apps/FeedBack-0-c812c99aa3818946dd0bcf5538e2aecd/app/node_modules/express/node_modules/connect/lib/middleware/query.js:44:5)
at next (/var/vcap/data/dea/apps/FeedBack-0-c812c99aa3818946dd0bcf5538e2aecd/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Function.handle (/var/vcap/data/dea/apps/FeedBack-0-c812c99aa3818946dd0bcf5538e2aecd/app/node_modules/express/node_modules/connect/lib/proto.js:198:3)
at Server.app (/var/vcap/data/dea/apps/FeedBack-0-c812c99aa3818946dd0bcf5538e2aecd/app/node_modules/express/node_modules/connect/lib/connect.js:66:31)
at Server.emit (events.js:67:17)
at HTTPParser.onIncoming (http.js:1134:12)