Update API routes function

This commit is contained in:
2026-04-10 11:34:22 +01:00
parent 7fb1784b95
commit 6477f446d1
5 changed files with 56 additions and 28 deletions
+7 -5
View File
@@ -121,11 +121,7 @@ export type APIResponseObject<T extends {
redirect?: string;
};
export type BunextServerRouteConfig = {
maxRequestBodyMB?: number;
};
export type PageDistGenParams = {
pageName: string;
page_file: string;
max_request_body_mb?: number;
};
export type LivePageDistGenParams = {
component?: FC;
@@ -299,3 +295,9 @@ export type GrabTSXModuleBatchMap = {
tsx: string;
page_file_path: string;
};
export type BunextAPIRouteHandler<T extends BunextAPIRouteJSONRes = BunextAPIRouteJSONRes & {
[k: string]: any;
}> = (params: BunxRouteParams) => Promise<Response | T> | Response | T;
export type BunextAPIRouteJSONRes = {
bunext_api_route_res_options?: ResponseInit;
};