Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,20 @@ production environment. Do not commit environment files.

The scheduled handler invokes the existing authenticated notification route.
Staging deliberately has no cron trigger: Vercel still runs the hourly job.
Before production cutover, attach the domain, connect automatic builds and
verify sign-in/chat. Disable the Vercel cron, then enable `0 * * * *` in the
production Worker's triggers. Keep Vercel available for rollback. Never enable
both schedulers together.
Production uses `wrangler.production.jsonc` on the same Worker after staging
verification. It attaches only the apex and `www` routes. The apex redirects to
`www` with HTTP 307, preserving paths and queries. Keep the wildcard and Clerk
DNS records unchanged.

written with GPT-6 in Codex (T3 Code)
GitHub `main` builds automatically in Cloudflare. Set the deploy command to
`bunx wrangler deploy --config wrangler.production.jsonc` after verifying sign-in
and chat. The default command continues to deploy staging until then.

Disable the Vercel cron before adding `0 * * * *` to the production Wrangler
configuration. Keep Vercel available for rollback. Never enable both schedulers
together.

written with gpt-6.1-sol in Codex (T3 Code)

## License

Expand Down
4 changes: 4 additions & 0 deletions src/server/cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ function createExports(manifest: SSRManifest) {
let astro = createAstroExports(manifest).default
let fetch: WorkerFetch = async (request, environment, context) => {
let url = new URL(request.url)
if (url.hostname === "tilly.social") {
url.hostname = "www.tilly.social"
return Response.redirect(url, 307)
}
if (url.pathname === "/app" || url.pathname.startsWith("/app/")) {
url.pathname = "/app/"
return environment.ASSETS.fetch(url.href)
Expand Down
19 changes: 19 additions & 0 deletions wrangler.production.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "tilly-migration",
"account_id": "568edba45e81a5b744aecae456748db4",
"main": "dist/_worker.js/index.js",
"compatibility_date": "2026-11-25",
"compatibility_flags": ["nodejs_compat"],
"workers_dev": true,
"preview_urls": false,
"routes": [
{ "pattern": "tilly.social/*", "zone_name": "tilly.social" },
{ "pattern": "www.tilly.social/*", "zone_name": "tilly.social" },
],
"assets": {
"directory": "./dist",
"binding": "ASSETS",
"run_worker_first": true,
},
}
Loading