Reputation:
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
- server
- server.js
- src
- app
- asserts
- environments
- angular html/css/ts
- node_modules
In order to runt his locally I have to run node server.js
in one cmd prompt and ng serve
in another. I hope to deploy this project to Azure but am not sure how to set this up so that it can run in a single app service. So:
Upvotes: 1
Views: 1176
Reputation: 21949
First of all, are the startup ports of your project, front-end angular project and back-end node service in the same configuration file?
If yes, then you can execute multiple commands by modifying the script in the package.json
file.
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.
Upvotes: 0