Add features: custom server and websocket. Minor refactoring

This commit is contained in:
2026-03-21 07:42:38 +01:00
parent 1611c845b9
commit 98d3cf7da7
29 changed files with 321 additions and 286 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
import type { MatchedRoute, Server } from "bun";
import type { MatchedRoute, ServeOptions, Server, WebSocketHandler } from "bun";
import type { FC, JSX, ReactNode } from "react";
export type ServerProps = {
params: Record<string, string>;
@@ -46,6 +46,8 @@ export type BunextConfig = {
development?: boolean;
middleware?: (params: BunextConfigMiddlewareParams) => Promise<Response | undefined> | Response | undefined;
defaultCacheExpiry?: number;
websocket?: WebSocketHandler<any>;
serverOptions?: ServeOptions;
};
export type BunextConfigMiddlewareParams = {
req: Request;