tangled-pages#
A simple way to host a website via a tangled repo. You can run it as a cloudflare worker or as an express server.
Setup#
Create a config.json for your site(s).
{
"site": {
"ownerDid": "did:plc:p572wxnsuoogcrhlfrlizlrb",
"repoName": "tangled-pages-example",
"knotDomain": "knot.gracekind.net", // optional, but recommended in workers to avoid an extra request
"branch": "main", // optional, defaults to main
"baseDir": "/public", // optional, defaults to the repo root
"notFoundFilepath": "/404.html" // optional, defaults to text 404
},
"cache": true // server only, not supported in workers (yet)
}
See config.multiple.example.json for an example of a multi-site config.
Then:
npm install
npx tangled-pages --config config.json
Example#
You can see an example of a hosted site here.
Limitations#
When cache: false, the server fetches files from the repo on every request, so it might be slow.
To-do#
- support
cache: truein workers - disk caching
- preloading