refactor(api): ♻️ Use OpenAPIHono instead of Hono in preparation for future changes

This commit is contained in:
Jesse Wierzbinski 2024-08-27 16:40:11 +02:00
parent 3c1b330d4b
commit df466ecaa0
No known key found for this signature in database
6 changed files with 10 additions and 8 deletions

View file

@ -1,6 +1,7 @@
import type { Context, Hono } from "@hono/hono";
import type { Context } from "@hono/hono";
import { createMiddleware } from "@hono/hono/factory";
import { validator } from "@hono/hono/validator";
import type { OpenAPIHono } from "@hono/zod-openapi";
import { getLogger } from "@logtape/logtape";
import { extractParams, verifySolution } from "altcha-lib";
import chalk from "chalk";
@ -46,7 +47,7 @@ export const applyConfig = (routeMeta: ApiRouteMetadata) => {
export const apiRoute = (
fn: (
app: Hono /* <{
app: OpenAPIHono /* <{
Bindings: {};
}> */,
) => void,

View file

@ -1,7 +1,7 @@
import type { Hono } from "@hono/hono";
import type { OpenAPIHono } from "@hono/zod-openapi";
import type { Config } from "~/packages/config-manager/config.type";
export const createServer = (config: Config, app: Hono) =>
export const createServer = (config: Config, app: OpenAPIHono) =>
Bun.serve({
port: config.http.bind_port,
reusePort: true,