Static site hosting via tangled
1# tangled-pages
2
3A simple way to host a website via a tangled repo.
4You can run it as a cloudflare worker or as an express server.
5
6## Run
7
8Create a `config.json` for your site(s).
9
10```json
11{
12 "site": {
13 "ownerDid": "did:plc:p572wxnsuoogcrhlfrlizlrb",
14 "repoName": "tangled-pages-example",
15 "knotDomain": "knot.gracekind.net", // optional, but recommended in workers to avoid an extra request
16 "branch": "main", // optional, defaults to main
17 "baseDir": "/public", // optional, defaults to the repo root
18 "notFoundFilepath": "/404.html" // optional, defaults to text 404
19 }
20}
21```
22
23See `config.multiple.example.json` for an example of a multi-site config.
24
25Then:
26
27```bash
28npm install
29npx tangled-pages --config config.json
30```
31
32## Example
33
34You can see an example of a hosted site [here](https://tangled-pages-example.gracekind.net).
35
36## Limitations
37
38The server fetches files from the repo on request, so it might be slow.
39In the future, we could cache the files and use a CI to clear the cache as needed.