···1-# fill in and rename to .env
2-# note these aren't secrets, just config
3-KNOT_DOMAIN = "knot.gracekind.net"
4-OWNER_DID = "did:plc:p572wxnsuoogcrhlfrlizlrb"
5-REPO_NAME = "tangled-pages-example"
6-BRANCH = "main"
···000000
+18-19
README.md
···3A simple way to host a website via a tangled repo.
4You can run it as a cloudflare worker or as an express server.
56-## Setup
78-Create .env pointing to the repo you want to host:
90000000000010```
11-KNOT_DOMAIN=knot.gracekind.net
12-OWNER_DID=did:plc:p572wxnsuoogcrhlfrlizlrb
13-REPO_NAME=tangled-pages-example
14-BRANCH=main
15-```
1617-Run server:
1819```bash
20npm install
21-npm start
22-```
23-24-## Config
25-26-You can configure the site by creating a `pages_config.yaml` file in the root of the hosted repo.
27-28-```yaml
29-baseDir: "/public"
30-notFoundFilepath: "404.html"
31```
3233## Limitations
3435-It fetches files from the repo on request, so it might be slow.
36In the future, we could cache the files and use a CI to clear the cache as needed.
···3A simple way to host a website via a tangled repo.
4You can run it as a cloudflare worker or as an express server.
56+## Run
78+Create a `config.json` for your site(s).
910+```json
11+{
12+ "site": {
13+ "knotDomain": "knot.gracekind.net",
14+ "ownerDid": "did:plc:p572wxnsuoogcrhlfrlizlrb",
15+ "repoName": "tangled-pages-example",
16+ "branch": "main",
17+ "baseDir": "/public", // optional
18+ "notFoundFilepath": "/404.html" // optional
19+ }
20+}
21```
22+23+See `config.multiple.example.json` for an example of a multi-site config.
0002425+Then run:
2627```bash
28npm install
29+npx tangled-pages --config config.json
00000000030```
3132## Limitations
3334+The server fetches files from the repo on request, so it might be slow.
35In the future, we could cache the files and use a CI to clear the cache as needed.