This is a Cloudflare worker that is used for rendering Orbiter sites. The worker does the following:
- Accepts direct requests or proxied requests (when someone is using a custom domain)
- Looks up the correct IPFS CID for the current version of the website
- Loads the site through a Pinata Dedicated IPFS Gateway
- Resolves all asset paths and html files
To run this project locally, you'll need to do the following:
- Clone the repository:
git clone https://github.com/orbiterhost/orbiter-website-worker.git
- Change into the directory:
cd orbiter-website-worker
- Install dependencies:
npm i
Before you can run the worker locally or deploy it to your own Cloudflare instance, you will need to update the wrangler.toml
file to include your own KV Bindings.
[[kv_namespaces]]
binding = "ORBITER_SITES"
id = ""
[[kv_namespaces]]
binding = "SITE_PLANS"
id = ""
[[kv_namespaces]]
binding = "SITE_TO_ORG"
id = ""
[[kv_namespaces]]
binding = "RATE_LIMIT"
id = ""
The ORBITER_SITE
, SITE_PLANS
, and SITE_TO_ORG
KV Binding IDs should be the same as the one you use with the orbiter-backend
repository. The RATE_LIMIT
binding will need to be created following this guide.
With all of this in place, you can run your worker with the following command:
npm run dev