diff options
| author | Rikki <i@rikki.moe> | 2025-05-26 14:25:17 +0800 |
|---|---|---|
| committer | Rikki <i@rikki.moe> | 2025-05-26 14:25:17 +0800 |
| commit | 818f6fdcfbfe296dab032af4023d98a1ac566fcf (patch) | |
| tree | b09da2a901c1c0e5c97ced1bddccf375b232fa08 /src/index.ts | |
Diffstat (limited to 'src/index.ts')
| -rw-r--r-- | src/index.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..faa50bb --- /dev/null +++ b/src/index.ts @@ -0,0 +1,20 @@ +import { Hono } from 'hono' +import { cors } from 'hono/cors' + +const app = new Hono<{ Bindings: Env }>() + +// blog-search +import * as blog_search from './blog_search' +app.use(blog_search.ROUTE_PATH, (c, next) => { + return cors({ + origin: c.env.ALLOWED_ORIGINS, + allowMethods: ['POST'], + allowHeaders: ['Content-Type'], + maxAge: 86400, + })(c, next); +}) +app.post(blog_search.ROUTE_PATH, blog_search.handle) + +export default { + fetch: app.fetch, +} as ExportedHandler<Env> |
