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## Setup 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 "cache": true // server only, not supported in workers (yet) 21} 22``` 23 24See `config.multiple.example.json` for an example of a multi-site config. 25 26Then: 27 28```bash 29npm install 30npx tangled-pages --config config.json 31``` 32 33## Example 34 35You can see an example of a hosted site [here](https://tangled-pages-example.gracekind.net). 36 37## Limitations 38 39When `cache: false`, the server fetches files from the repo on every request, so it might be slow.