mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
Merge e5f71dcdbb into 83397ebde2
This commit is contained in:
commit
e0d0d01539
1 changed files with 5 additions and 0 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue