I have a war file with spring boot as server side and angular 8 as front end.
and the war is getting deployed in remote machine where ip changes on restart.
If I deploy the war where rest request call from angular are made with ip address of the host it was working fine
http://54.172.42.170:8080/test/getMessage since the IP is changing on each time machine restart i need to change the code each time
Is there a way where i can make the rest call with out referring ip address, as both angular and spring boot are packaged in same war
i tried using local host in the rest url , but getting error
ERR_CONNECTION_REFUSED it was working only when war is deployed in my desktop not on remote machine, which makes sense.
Adding Client Code:
public SERVER_IP:string="54.172.42.170"; public SERVER_PORT:string="8080"; public SERVER_PROTOCOL:string="http"; public APP_CONTEXT:string="test"; public URL_BASE:string= this.SERVER_PROTOCOL+"://"+this.SERVER_IP+":"+this.SERVER_PORT+"/"+ this.APP_CONTEXT+"/"; public URL_GET_MESSAGE:string= this.URL_BASE +"getMessage"; this.http.get(this.constant.URL_GET_MESSAGE,{params: data})