In Angular CLI you can set custom port with the --port
command, --port=4201
for example.
What I need to do is somehow get this port value so I can point to the correct server in my code but I'm unable to find such a way.
The reason for this is because if I use the default 4200
like this:
export const environment = {
production: false,
host: 'http://localhost:4200'
}
Then I won't be able to use --port
without the code breaking.
Is this possible?