mirror of
https://github.com/get-drexa/drive.git
synced 2025-12-01 14:01:40 +00:00
15 lines
298 B
TypeScript
15 lines
298 B
TypeScript
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 }
|