This commit is contained in:
orbisai0security 2025-12-23 15:42:19 +08:00 committed by GitHub
commit e0d0d01539
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,6 +7,7 @@ import { Hono } from "hono"
import { cors } from "hono/cors"
import { stream, streamSSE } from "hono/streaming"
import { proxy } from "hono/proxy"
import { rateLimitMiddleware } from "hono/rate-limit"
import { Session } from "../session"
import z from "zod"
import { Provider } from "../provider/provider"
@ -96,6 +97,10 @@ export namespace Server {
timer.stop()
}
})
.use(rateLimitMiddleware({
windowMs: 15 * 60 * 1000, // 15 minutes
limit: 100, // limit each IP to 100 requests per windowMs
}))
.use(cors())
.get(
"/global/health",