Skip to content

Commit e253e29

Browse files
authored
Merge pull request #308 from StachuDotNet/add-client-asset-tunneling-instructions
Add instructions for client asset tunnelling
2 parents 0995448 + ceee21d commit e253e29

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
id: client-asset-tunnelling
3+
title: Client Asset Tunnelling
4+
---
5+
6+
The best way to work on the Dark client is by building it against the production
7+
Dark APIs. In the future as we move more part of the editor to be built in Dark,
8+
it will become the only way to work on the Dark client.
9+
10+
![Client asset tunnelling](/img/contributing/client-asset-tunnelling.gif)
11+
12+
## Host the static assets locally
13+
14+
First, you'll need a web server on your machine to host the static assets. The
15+
editor's build artifacts are hosted in `backend/static`, so you'll need to host
16+
that directory. Many tools can be used to accomplish this task - here's how to
17+
do this with the [static-server](https://www.npmjs.com/package/static-server)
18+
npm package.
19+
20+
- `cd backend/static`
21+
- `npx static-server --cors '*' --port [port]`
22+
23+
You can choose any port available locally, and `--cors '*'` instructs the server
24+
to include `access-control-allow-origin: *` headers for all requests.
25+
26+
## Create the tunnel to expose this web server to the internet
27+
28+
Now, create a tunnel to expose the webserver to the internet.
29+
30+
- Install [ngrok](https://ngrok.com) on your machine
31+
- `ngrok http [port]` to create the tunnel on the port where your webserver is
32+
serving the static assets
33+
34+
Alternative tools include [localtunnel.me](https://localtunnel.me) and
35+
[Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/).
36+
37+
## Register the tunnel in the Editor
38+
39+
Finally, use the tunnel in the editor:
40+
41+
- Go to Settings (from the icon in the top-right of the editor)
42+
- Go to the Contributing tab
43+
- Enter the hostname provided to you by your tunnel
44+
- Choose to "Use tunneled assets"
45+
46+
This will cause a refresh of the editor, with static assets being served through
47+
the tunnel from your local dev environment.

sidebars.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@
183183
"contributing/glossary",
184184
"contributing/debugging",
185185
"contributing/troubleshooting",
186+
"contributing/client-asset-tunnelling",
186187
"contributing/making-a-pull-request"
187188
]
188189
}
637 KB
Loading

0 commit comments

Comments
 (0)