Using localhost URL in Mac OS- AngularJS

If you want to use https://something.i.want.com:8080 instead of the same old boring  https://localhost:8080 localhost URL there is a way. Let’s see how to do that on a Mac OS.

The IP address of localhost is 127.0.0.1. It is an alias. To modify it follow the below instructions.

 1. Access vi /etc/hosts with sudo command

$sudo vi /etc/hosts

2.Then the terminal will show many lines like the following.

#Localhost is used to configure the loopback interface
#When the system is booting. Do not change this entry.
##
127.0.0.1                localhost
255.255.255.255          broadcasthost
::1                      localhost

3. Add the alias in the line below  the IP address. 127.0.0.1                localhost.

Eg:

#Localhost is used to configure the loopback interface
#When the system is booting. Do not change this entry.
##
127.0.0.1                localhost
127.0.0.1                api.something.i.want.com
255.255.255.255          broadcasthost
::1                      localhost

4.Now save the file. exit .