chatgpt-api/apps/api/src/server.ts

17 wiersze
362 B
TypeScript
Czysty Zwykły widok Historia

2025-04-22 23:57:59 +00:00
import { Hono } from 'hono'
import * as middleware from '@/lib/middleware'
2025-04-23 01:21:18 +00:00
import type { AuthenticatedEnv } from './lib/types'
2025-04-22 23:57:59 +00:00
export const app = new Hono()
2025-04-23 01:21:18 +00:00
const pub = new Hono()
const pri = new Hono<AuthenticatedEnv>()
2025-04-22 23:57:59 +00:00
2025-04-23 01:21:18 +00:00
app.route('/', pub)
2025-04-22 23:57:59 +00:00
app.use('*', middleware.authenticate)
2025-04-23 01:21:18 +00:00
app.use('*', middleware.team)
app.use('*', middleware.me)
app.route('/', pri)