From a687c3094f62028b2c6afc8feb46078ddfad9301 Mon Sep 17 00:00:00 2001
From: deptyped <deptyped@gmail.com>
Date: Tue, 28 May 2024 04:06:07 +0300
Subject: [PATCH] Move server environment type to a separate file

---
 src/server/environment.ts | 8 ++++++++
 src/server/index.ts       | 9 +--------
 2 files changed, 9 insertions(+), 8 deletions(-)
 create mode 100644 src/server/environment.ts

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<Env>()