【发布时间】:2019-08-20 17:08:37
【问题描述】:
我已经在现场上传了我的 Angular 制作版本。我错过了一些东西,但我不知道那是什么。
在build/index.html 中,我已经在基本 URL 中设置了它。
<base href="http://0.0.0.0:3000/admin/"> // Instead of 0.0.0.0 I have set my EC2 instance's elastic ip address
我设置了/var/www/html/myapp/admin。在 admin 文件夹中听到 angular build 是这样的。
我的节点服务器位于/var/www/html/app.js
app.js
为了允许所有管理面板页面,我在我的 app.js 文件中添加了此代码。
app.use('/', express.static('./admin'))
app.get('*', (req, res) => {
res.sendfile('./admin/index.html')
})
【问题讨论】:
标签: node.js angular live production