feat: update to 0.0.12

This commit is contained in:
2025-04-18 01:16:06 +08:00
parent 17e515ad32
commit afad59e0ab
7 changed files with 73 additions and 27 deletions

View File

@@ -101,3 +101,5 @@ export class App<T = {}, U = AppReqRes> {
throw new CustomError(...args);
}
}
export * from './browser.ts';

View File

@@ -1,13 +0,0 @@
import { Route, QueryRouter, QueryRouterServer } from './route.ts';
export { App } from './app.ts';
export { Route, QueryRouter, QueryRouterServer };
export { Rule, Schema, createSchema } from './validator/index.ts';
export type { RouteContext, RouteOpts } from './route.ts';
export type { Run } from './route.ts';
export { CustomError } from './result/error.ts';

View File

@@ -1,8 +1,10 @@
// @ts-type=ws
import { WebSocketServer } from 'ws';
import type { WebSocket } from 'ws';
import { Server } from './server.ts';
import { parseIfJson } from '../utils/parse.ts';
export const createWsServer = (server: Server) => {
// 将 WebSocket 服务器附加到 HTTP 服务器
const wss = new WebSocketServer({ server: server.server as any });