Search code examples
node.jsraspberry-piipip-address

Can I access my local NodeJS server with readable address instead of http://192.168.x.x/


I've developed, for a structure, an application with ReactJS and NodeJS. React is rendered by the NodeJS server which is running on a Raspberry Pi 3b+.

The all application is local only, so to access it the employees have to type the local address of the Raspberry in their navigator like http://192.168.0.51/someroute which is not really convenient.

So my question is : Can I, in some way, make this local adress look like a "real" adress like http://mylocalapplication/someroute.

I have access to the admin panel of the router.

Thanks in advance,


Solution

  • You can achieve that by adding the IP and the domain you want to bind to your system's hosts file. On MacOS and Ubuntu it's located at /etc/hosts.

    Just add a line in the following format:

    1.2.3.4 localdomain.com