Non-local development
Reboot provides an excellent local development experience, allowing you to develop apps on your machine that seamlessly transfer to production. For some applications, however, purely local development is not sufficient. You may for example want to try your Reboot application on your phone, or you may want to test it with somebody who is not sitting at your computer.
Deploying to a dedicated testing environment
You may deploy your Reboot application to a testing environment. This works just like deploying to production, but the deployment is kept private (typically by using a different domain name).
This approach gives you a production-like environment to test with, but does not support convenient features like live-updating of your application.
Tunnels
You can use a third-party "development tunnel", like bore or ngrok, to give your normal local development environment an internet-public URL. How to configure these tunnels is dependent on the tunnel service you choose.
All of the instructions below assume that you are running a Reboot development
instance on port 9991
.
bore
bore
is an open-source TCP forwarder, with
a free public service hosted at bore.pub
. No registration is required.
To forward your local Reboot development instance running on port 9991
, run the
following:
docker run -it --init --rm --network host ekzhang/bore local 9991 --to bore.pub
This will print a new hostname and port, for example:
INFO bore_cli::client: listening at bore.pub:36963
In this example, your new hostname is bore.pub
and your new port is 36963
.
Next, bypass the SSL certificate warning on each of your browsers.
You may now update your frontend to use the tunnel, allowing you to access your application from anywhere.
ngrok
It is possible to use ngrok with Reboot, with a little setup.
Before you begin:
- Make sure you are signed up on ngrok.com, and that you
have verified your identity via a credit
card. You do not
need to pay for
ngrok
to use it with Reboot, but you must use a verified account. - Install the
ngrok
CLI on the machine that runsrbt dev run
. Follow the instructions onngrok.com
to store your credentials in anngrok.yml
file.
To forward your local Reboot development instance running on port 9991
, run the
following:
ngrok tcp dev.localhost.direct:9991
This will print a tcp://...
URL, for example:
Forwarding tcp://0.tcp.eu.ngrok.io:12345 -> dev.localhost.direct:9991
Since Reboot uses both gRPC and HTTP websocket connections, we must use
ngrok tcp
instead of ngrok http
.
In this example, your new hostname is 0.tcp.eu.ngrok.io
and your new port is
12345
.
Next, bypass the SSL certificate warning on each of your browsers.
You may now update your frontend to use the tunnel, allowing you to access your application from anywhere.
Bypassing SSL certificate warnings
Because our local development environment is using SSL certificates for
dev.localhost.direct
, but the URLs we use while tunneling use different
hostnames, we must get our web browser to accept an SSL certificate mismatch. To
do so:
- Go to
https://YOUR_TUNNEL_HOSTNAME:YOUR_TUNNEL_PORT/__/inspect
- When your browser tells you about the certificate mismatch, tell it to
disregard it.
- On Chrome, click
Advanced
, thenProceed to ... (unsafe)
.
- On Chrome, click
- You will now see your inspect page, asking you to
Enter Admin Token
. This means the connection is working! If you'd like to use the inspect page: during development, any admin token is accepted. - You must repeat these steps once for every browser you will use with the application.
Changing the backend URL in the frontend
The tunnel service you've chosen will have given you a new hostname and port for your application. If you haven't already, you should first bypass the SSL certificate warnings your browser raises for these.
You may then use this hostname and port into your frontend's .env
file,
replacing dev.localhost.direct:9991
. For example:
REACT_APP_REBOOT_URL=https://bore.pub:36963
You may now serve your frontend as normal (or, if desired, via its own tunnel). It will access the backend via the tunnel host you've provided, making it accessible anywhere on the internet!