[英]Deploying Mean Stack Application on Heroku Issue
This is my first time building a MEAN stack application and I built it locally.这是我第一次构建 MEAN 堆栈应用程序,并且是在本地构建的。 Now I am trying to host it on heroku and I think I messed it up.现在我试图将它托管在 heroku 上,我想我把它搞砸了。 I went through different questions here and most of them said both angular and express needs to be in one single app.我在这里遇到了不同的问题,其中大多数人说 angular 和 express 都需要在一个应用程序中。 I din't know that, So here's my current folder structure.我不知道,所以这是我当前的文件夹结构。
Project Root Folder
|
|
|------ Frontend (Angular App)
|
|
|------- Backend (Express App)
I tried searching everywhere but couldn't figure out what changes I need to make to my current project structure.我尝试到处搜索,但无法弄清楚我需要对当前项目结构进行哪些更改。 Any tips or help or even a link to a guide would be much appreciated.任何提示或帮助,甚至是指南的链接都将不胜感激。
For hosting as a single app作为单个应用程序托管
app.use('*', express.static('Frontend/build/'))
index.js
)在后端的启动脚本中构建 angular 应用程序并启动服务器文件( index.js
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.