update: fix docs

This commit is contained in:
2025-06-20 16:20:56 +08:00
parent d2ebb5f488
commit 187900ad55
6 changed files with 45 additions and 10 deletions

View File

@@ -105,6 +105,12 @@ export class App<T = {}, U = AppReqRes> {
static handleRequest(req: IncomingMessage, res: ServerResponse) {
return handleServer(req, res);
}
onServerRequest(fn: (req: IncomingMessage, res: ServerResponse) => void) {
if (!this.server) {
throw new Error('Server is not initialized');
}
this.server.on(fn);
}
}
export * from './browser.ts';