Package Exports
- now-url-hub
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (now-url-hub) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
now-url-hub
A little devops module that helps you figure out and access your OSS now deployment urls.
Use case
You are deploying on now under the OSS plan. You serve a frontend that does reconnect to your backend, for establishing websockets or similar. Without server side rendering, how do you know your server's address? -> now-url-hub.
Usage
When deploying your server on now you need to run this module's cli in order to post your deployment url under an alias. That way, the now-url-hub server always has the latest deployment url:
Run
now secrets add now_url_hub_password <YO PASSWORD>from a terminal. The password is used to ensure that only you can update the url an alias points to.When running
nowor insidenow.jsonpass yo password on as environment variable:
{
...,
"env": {
"NOW_URL_HUB_PASSWORD": "@now_url_hub_password"
}
}- Run the
now-url-hubcli with no arguments (for convenience). If you have anpmtype deployment usenpm's prestart script for that. If using docker just RUN the cli with the required environment variableNOW_URL_HUB_PASSWORDin place.
Accessing a mapping is a simple get from https://now-url-hub-ipmtcknuik.now.sh/alias/${YO_ALIAS}; returns JSON like:
{
"alias": "yo_alias",
"url": "yo_alias-ipmtcknuik.now.sh"
}Get it!
npm install --save now-url-hub