Well, I'm trying to test a web application built in Angular 12 from my android smartphone or another pc using Chrome or Edge and it seems that the URL is being corrupted in the way from my device to te Angular application. I ran the command below to start the front-end:
ng serve --host 192.168.1.65 --port 64000 --disable-host-check
and the Angular page is correctly loaded on the browser after address 192.168.1.65:64000 is reached but the request to the backend isn't working. The predefined message that I've wrote to say that something was missing when an unknown error code is returned pops up but I'm writing everything right, e.g.:
localhost:8080/9.5/94850230/95010003/Miguel
this is the final url created on frontend after all the form fields are filled and send button is clicked. After click the send button the frontend receives an Unknow Error code (out of codes range 400, 500) as an answer. As you can see, the four variables are present in the url, weight (kg), origin zip code (not USA format), destination zip code, receiver name.
Am I trying to test the wrong way?
Can an Angular app to be loaded on browser on a remote machine other than where is the server runnning and works as if the browser were on the same physical machine where the server is located?
Accessing from the same machine where the front-end and back-end are running all works well.
Can someone explain this issue? Thanks.
Ok, I found my mistake. The apiUrl
was written in the frontend code to be:
localhost:8080
But the correct format is:
192.168.1.65:8080
So that other devices in the same network can also access the server/backend resource