【发布时间】:2014-09-02 14:04:43
【问题描述】:
我正在尝试在 azure 上部署一个简单的应用程序,该应用程序需要名字和姓氏。我已经使用 express 搭建了脚手架,由于某种原因,当我尝试访问它时网页是空白的。
我想我已经找到了问题的一部分(我使用的示例代码来自默认的 express 应用程序),其中 express 生成的默认代码在 index.js 路由文件中使用:
/* GET home page. */
router.get('/', function(req, res) {
res.render('index', { title: 'Express' });
});
module.exports = router;
但我已将其更改为单独的导出,使其看起来更像这样。
exports.index = router;
我还对 app.js 进行了适当的修改,使其看起来像这样:
app.use('/', routes).index;
app.use('/users', users);
修改后的应用程序在本地运行,但是一旦我部署它,页面就显示为空白。有谁知道为什么?感谢您的阅读。
【问题讨论】:
标签: node.js azure deployment express