Make Application Work on Local Network Only - Localhost

Asked

Viewed 703 times

-1

Good morning to all.

Guys, I have a network in a client of 3 computers. As there is no internet on the server works with the following address the registration of users.

http://localhost:8070/users.html

If I click on a button called List All, this computer shows all users who are in the database.

My scope in Angular is as below and works on the main computer that would be a server, only at the client location.

inserir a descrição da imagem aqui

Now arise the need to put the same application on two other machines and I did the following :

http://192.168. 0.142:8070/users.html

The screen of the user registration is even presented, but in turn, when I click on the button list all it informs that it could not communicate with the target host.

Does anyone have any idea how I should proceed to make the system work only on a local network without relying on the internet or some exposed address ddns ?

  • Josemar, edit your question by pasting your code and not a print. For more information, see how to ask good questions

1 answer

0

Instead of localhost:8070, use the ip of your application 192.168.0.142:8070 to access both the url and the services within your application.

If your services are the same as your application I suggest using only "/users" in the variable urlDestino.

  • Marciano, beauty ? Man, the suggestion that solved the problem was the case of using only /users in the urlDestino. Having done this I did tests on several other computers and it worked. I didn’t really understand why it wasn’t working. There’s some explanation easier to understand, because I’m new to this Java and Angular world.

  • Hello Josemar. Following your architecture, you have two types of computers: - o host (server) - o client computers that access the server Angular is done in javascript that is part of the front-end layer that runs your application. .

Browser other questions tagged

You are not signed in. Login or sign up in order to post.