mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(api): ♻️ Use OpenAPIHono instead of Hono in preparation for future changes
This commit is contained in:
parent
3c1b330d4b
commit
df466ecaa0
6 changed files with 10 additions and 8 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue