refactor: migrate HTTP routing to Hono framework

- Add hono dependency
- Replace if/else routing chain with Hono app
- Convert all HTTP routes to Hono format:
  - GET /health, /setup-webhook, /webhook-info
  - POST /webhook
  - ALL /api/*
  - GET /
- Keep email, scheduled, queue handlers unchanged
- Maintain 100% backward compatibility

Benefits:
- Cleaner declarative routing
- Type-safe Env bindings
- Ready for future middleware (CORS, rate limiting)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
kappa
2026-01-29 09:40:38 +09:00
parent 41f99334eb
commit 2756dbe804
3 changed files with 77 additions and 68 deletions

10
package-lock.json generated
View File

@@ -8,6 +8,7 @@
"name": "telegram-summary-bot",
"version": "1.0.0",
"dependencies": {
"hono": "^4.11.7",
"zod": "^4.3.5"
},
"devDependencies": {
@@ -2625,6 +2626,15 @@
"node": ">= 0.4"
}
},
"node_modules/hono": {
"version": "4.11.7",
"resolved": "https://registry.npmjs.org/hono/-/hono-4.11.7.tgz",
"integrity": "sha512-l7qMiNee7t82bH3SeyUCt9UF15EVmaBvsppY2zQtrbIhl/yzBTny+YUxsVjSjQ6gaqaeVtZmGocom8TzBlA4Yw==",
"license": "MIT",
"engines": {
"node": ">=16.9.0"
}
},
"node_modules/html-escaper": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",