Deploy node.js server and angular app to azure web service

后端 未结 1 849
清酒与你
清酒与你 2021-01-27 04:22

I have an Angular app (9.1.4) and a node.js server application (12.14.1). My files are currently configured like this:

MyApp
- package.json
- angular.json
- serve         


        
相关标签:
1条回答
  • 2021-01-27 05:16

    First of all, are the startup ports of your project, front-end angular project and back-end node service in the same configuration file?

    1. If yes, then you can execute multiple commands by modifying the script in the package.json file.

    2. Because only 443 and 80 ports are supported in azure web app. If the port configuration of the two projects is not the same, it may run normally locally.

    For example, the ng project is 7001, and the server project is 7002, deployed to the azure web app, according to the process.env.PORT parameters, it will the port conflicts and the project cannot be started.

    So if it is the second case, how to deal with:

    You can use virtual applications to deploy your applications separately. For more details, you can see my answer in another post.

    0 讨论(0)
提交回复
热议问题