I am building an angular application. The app will connect with server through httpClient. Each time when the app connect to the server, it uses different port. I want to configure the port number of this app, then every time when the app open the socket to communicate with the server, the app will always use the same port.
It is possible to do that?
And ng serve uses default port number 4200 to run the angular application.
With latest version of angular-cli, you can change the port by editing angular.json file you now specify a port per "project"
projects": {
"my-cool-project": {
... rest of project config omitted
"architect": {
"serve": {
"options": {
"port": 4500
}
}
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With