feat: add Swagger OpenAPI documentation endpoints

This commit is contained in:
MythEclipse
2026-05-18 07:39:27 +07:00
parent aae8ebfbcf
commit 6feca3564a
4 changed files with 318 additions and 1 deletions
+7
View File
@@ -3,6 +3,7 @@ import { startBot } from './bot';
import { config } from './env';
import { handleFileInfo, handleFileRedirect } from './routes/files';
import { handleHealth } from './routes/health';
import { handleSwaggerHtml, handleSwaggerJson } from './routes/swagger';
import { handleUpload } from './routes/upload';
import logger from './utils/logger';
import { cleanupRateLimitCache } from './utils/rateLimit';
@@ -22,6 +23,12 @@ const server = serve({
'/health': {
GET: handleHealth,
},
'/docs': {
GET: handleSwaggerHtml,
},
'/swagger.json': {
GET: handleSwaggerJson,
},
},
});