temp
This commit is contained in:
parent
e31b19f931
commit
d2a03fc959
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json.schemastore.org/package",
|
"$schema": "https://json.schemastore.org/package",
|
||||||
"name": "@kevisual/router",
|
"name": "@kevisual/router",
|
||||||
"version": "0.0.21-beta",
|
"version": "0.0.21",
|
||||||
"description": "",
|
"description": "",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/router.js",
|
"main": "./dist/router.js",
|
||||||
|
@ -2,6 +2,8 @@ import { QueryRouter, Route, RouteContext, RouteOpts } from './route.ts';
|
|||||||
import { Server, ServerOpts, HandleCtx } from './server/server.ts';
|
import { Server, ServerOpts, HandleCtx } from './server/server.ts';
|
||||||
import { WsServer } from './server/ws-server.ts';
|
import { WsServer } from './server/ws-server.ts';
|
||||||
import { CustomError } from './result/error.ts';
|
import { CustomError } from './result/error.ts';
|
||||||
|
import { handleServer } from './server/handle-server.ts';
|
||||||
|
import { IncomingMessage, ServerResponse } from 'http';
|
||||||
|
|
||||||
type RouterHandle = (msg: { path: string; [key: string]: any }) => { code: string; data?: any; message?: string; [key: string]: any };
|
type RouterHandle = (msg: { path: string; [key: string]: any }) => { code: string; data?: any; message?: string; [key: string]: any };
|
||||||
type AppOptions<T = {}> = {
|
type AppOptions<T = {}> = {
|
||||||
@ -100,6 +102,9 @@ export class App<T = {}, U = AppReqRes> {
|
|||||||
throw(...args: any[]) {
|
throw(...args: any[]) {
|
||||||
throw new CustomError(...args);
|
throw new CustomError(...args);
|
||||||
}
|
}
|
||||||
|
static handleRequest(req: IncomingMessage, res: ServerResponse) {
|
||||||
|
return handleServer(req, res);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export * from './browser.ts';
|
export * from './browser.ts';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user