Skip to content

Commit

Permalink
Move server environment type to a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
deptyped committed May 28, 2024
1 parent 52ce85d commit a687c30
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 8 additions & 0 deletions src/server/environment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { Logger } from '#root/logger.js'

export interface Env {
Variables: {
requestId: string
logger: Logger
}
}
9 changes: 1 addition & 8 deletions src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>()
Expand Down

0 comments on commit a687c30

Please sign in to comment.