diff options
Diffstat (limited to 'src/worker.ts')
| -rw-r--r-- | src/worker.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/worker.ts b/src/worker.ts new file mode 100644 index 0000000..e982634 --- /dev/null +++ b/src/worker.ts @@ -0,0 +1,18 @@ +import type { SSRManifest } from 'astro'; +import { App } from 'astro/app'; +import { handle } from '@astrojs/cloudflare/handler'; +import { handleSchedule } from './functions/scheduled'; + +export function createExports(manifest: SSRManifest) { + const app = new App(manifest); + return { + default: { + async fetch(request, env, ctx) { + return handle(manifest, app, request, env, ctx); + }, + async scheduled(controller, env, ctx) { + return await handleSchedule(controller, env, ctx); + } + } + }; +} |
