()
| 4 | import { type AiEnv, apiKeyMiddleware } from './apiKey'; |
| 5 | |
| 6 | function createApp() { |
| 7 | const app = new Hono<AiEnv>(); |
| 8 | app.use('*', apiKeyMiddleware); |
| 9 | app.get('/test', (c) => |
| 10 | c.json({ |
| 11 | aiApiKey: c.get('aiApiKey'), |
| 12 | aiBaseUrl: c.get('aiBaseUrl'), |
| 13 | aiModel: c.get('aiModel'), |
| 14 | }), |
| 15 | ); |
| 16 | return app; |
| 17 | } |
| 18 | |
| 19 | describe('apiKeyMiddleware', () => { |
| 20 | const originalEnv = { ...process.env }; |