Files
drive/apps/file-proxy/auth.ts

15 lines
298 B
TypeScript
Raw Normal View History

2025-10-21 23:45:04 +00:00
import { createMiddleware } from "hono/factory"
export type ApiKeyContextVariable = {
apiKey: string
}
const apiKeyMiddleware = createMiddleware<{ Variables: ApiKeyContextVariable }>(
async (c, next) => {
c.set("apiKey", process.env.API_KEY)
await next()
},
)
export { apiKeyMiddleware }