This project sets up a Cloudflare Worker with a Svelte frontend using the latest tools.
Make sure you have the following installed:
To install Wrangler globally:
npm install -D wrangler@latest
npm create cloudflare@latest -- <name-of-worker>
Follow the prompts and select Svelte when asked for a template.
Replace the file at:
my-svelte-app/src/routes/+page.svelte
with your custom version from the worker
.
npm run deploy
Your worker should now be live.
You can access the deployed app at:
https://worker-svelte.alireza78-bk.workers.dev/
my-svelte-app/
βββ src/
β βββ routes/
β βββ +page.svelte <-- Replace this file
βββ wrangler.toml
βββ package.json
βββ ...
npx wrangler secret put <YOUR_SECRET_NAME>