This PR keeps the default behavior for when you run npm run dev so that your $localhost in the login drop down translates to http://localhost:5988, but adds three new env vars:
CHT_DEV_URL_PORT - the URL and port of a dev instance - eg 192-168-68-26.local-ip.medicmobile.org:10463
CHT_DEV_HTTP - if the dev instance is running http or https. will get translated from literal string to boolean.
INTERFACE - which interface to bind to - defaults to 0.0.0.0 if unset for backwards compatibility.
This also adds a debug output in stdout when you login of either:
"failed to login to " + sessionUrl or
"successfully logged in to " + sessionUrl
You can not login when the IP is 0.0.0.0 so I changed it to allow you to specify which interface it binds to (see INTERFACE in readme) and strongly encourage the user to change this to 127.0.0.1 in a dev environment. we only print out one line about which URL to use so it should set the dev up for more success on first use:
3:55:20 PM - Found 0 errors. Watching for file changes.
Using configuration: chis-ke
Server is listening on http://127.0.0.1:3000
Finally, it changes the drop down from $localhost to Development Instance (CHT_DEV_URL_PORT) as the localhost may not be local any more ;)
This PR keeps the default behavior for when you run
npm run dev
so that your$localhost
in the login drop down translates tohttp://localhost:5988
, but adds three new env vars:CHT_DEV_URL_PORT
- the URL and port of a dev instance - eg192-168-68-26.local-ip.medicmobile.org:10463
CHT_DEV_HTTP
- if the dev instance is runninghttp
orhttps
. will get translated from literal string to boolean.INTERFACE
- which interface to bind to - defaults to0.0.0.0
if unset for backwards compatibility.This also adds a debug output in
stdout
when you login of either:"failed to login to " + sessionUrl
or"successfully logged in to " + sessionUrl
You can not login when the IP is
0.0.0.0
so I changed it to allow you to specify which interface it binds to (seeINTERFACE
in readme) and strongly encourage the user to change this to127.0.0.1
in a dev environment. we only print out one line about which URL to use so it should set the dev up for more success on first use:Finally, it changes the drop down from
$localhost
toDevelopment Instance (CHT_DEV_URL_PORT)
as the localhost may not be local any more ;)per #14