Skip to content

Commit e482ffa

Browse files
committed
feat: add health check API endpoint
- Introduced a new GET endpoint for health checks. - Returns the status, current timestamp, enabled providers, and rate limit information. - Utilizes environment variables for rate limit configuration.
1 parent bcacf10 commit e482ffa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { env } from "@/env";
2+
import { providers } from "@/providers/registry";
3+
4+
export function GET() {
5+
const enabledProviders = providers.map((p) => p.name);
6+
7+
return Response.json({
8+
status: "ok",
9+
timestamp: new Date().toISOString(),
10+
providers: enabledProviders,
11+
rateLimit: !!(env.UPSTASH_REDIS_REST_URL && env.UPSTASH_REDIS_REST_TOKEN),
12+
});
13+
}

0 commit comments

Comments
 (0)