Hapi.js URL resolver
URL resolver for Hapi.js
How to use
Returns an URL object representing the current server's URL:
const HapiUrl = ;console;console;console;
Or, you can also write as:
const HapiUrl = ;console;console;
hapi-url
looks for x-forwarded-proto
and x-forwarded-host
to resolve the current URL correctly when behind a reverse proxy.
If hapi-url
is not clever enought for your case, you can override the protocol
, host
and basePath
. basePath
can be used to resolve the URL when the proxy adds a prefix in the path:
const HapiUrl = ;Hapiconsole;
Example
const Hapi = ;const HapiUrl = ; const server = port: 3000; server; serverstart;