diff --git a/src/server/environment.ts b/src/server/environment.ts new file mode 100644 index 00000000..9d16d364 --- /dev/null +++ b/src/server/environment.ts @@ -0,0 +1,8 @@ +import type { Logger } from '#root/logger.js' + +export interface Env { + Variables: { + requestId: string + logger: Logger + } +} diff --git a/src/server/index.ts b/src/server/index.ts index 7121bbed..9e0b4d65 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -4,17 +4,10 @@ import { webhookCallback } from 'grammy' import { getPath } from 'hono/utils/url' import { requestId } from './middlewares/request-id.js' import { logger } from './middlewares/logger.js' +import type { Env } from './environment.js' import type { Bot } from '#root/bot/index.js' import { config } from '#root/config.js' import { requestLogger } from '#root/server/middlewares/request-logger.js' -import type { Logger } from '#root/logger.js' - -interface Env { - Variables: { - requestId: string - logger: Logger - } -} export function createServer(bot: Bot) { const server = new Hono()