How to access ngrest services with IP address instead of localhost

150 views
Skip to first unread message

vivek pandya

unread,
Nov 13, 2016, 12:12:29 PM11/13/16
to ngrest
Hi,

After building a project with ngrest I am able to access services with localhost but when I replace localhost with IP address assigned to my system it fails.
I want to access my service on a LAN network so my ngrest project should be able to be accessed with IP address assigned to my system.

Kindly provide guidance.

Sincerely,
Vivek

Dmitry Utkin

unread,
Nov 13, 2016, 1:24:07 PM11/13/16
to ngrest
Hi,

By default it binds to localhost. To bind to specific address you should specify it by setting NGREST_SERVER_IP environment variable, for example:

NGREST_SERVER_IP=192.168.0.100 ngrest


Or to bind to all available interfaces, use 0.0.0.0 ip address:

NGREST_SERVER_IP=0.0.0.0 ngrest


воскресенье, 13 ноября 2016 г., 20:12:29 UTC+3 пользователь vivek pandya написал:

vivek pandya

unread,
Nov 13, 2016, 1:41:53 PM11/13/16
to ngrest
Hi Dmitry Utkin,

Thanks for the infromation. I also find this thing after reading scripts/ngrest file. But for this kind of small things like custom port, IP it would be better if you just add note to README page.

Sincerely,
Vivek

Dmitry Utkin

unread,
Nov 14, 2016, 2:52:31 AM11/14/16
to ngrest
Hi,

Actually it was intended to bind to any available interfaces by default. But after some ngrest script update it now binds to localhost. I will fix it.

Here is the ngrest script reference: https://github.com/loentar/ngrest/wiki/ngrest-script

воскресенье, 13 ноября 2016 г., 21:41:53 UTC+3 пользователь vivek pandya написал:
Reply all
Reply to author
Forward
0 new messages