How to get server IP-address in an Angular application?

Viewed 310

How to get the server host IP-address in Angular app started with ng serve --host 0.0.0.0?

The IP-Adress will be used when communicate with the backend server.

Since each coworker has its own IP-Address I should like to avoid to have it hardcoded in the code. I can´t use localhost either since then my coworkers can´t access it.

Is angular running completely on client side or is it possible to add something to fetch the IP-Address when the application get the first request?

0 Answers
Related