fix record

This commit is contained in:
Rizky 2024-12-11 16:38:22 +07:00
parent 4687513434
commit a09cf17451
2 changed files with 10 additions and 1 deletions

View File

@ -18,5 +18,6 @@ export const serveWeb = async (arg: {
cache_accept: arg.cache_accept,
high_compression: true,
headers: !type ? undefined : { "content-type": type },
rewrite: arg.opt?.rewrite,
});
};

View File

@ -30,7 +30,15 @@ type PrasiServer = {
req: Request;
server: Server;
mode: "dev" | "prod";
handle: (req: Request) => Promise<Response>;
handle: (
req: Request,
opt?: {
rewrite?: (arg: {
body: Bun.BodyInit;
headers: Headers | any;
}) => Bun.BodyInit;
}
) => Promise<Response>;
index: { head: string[]; body: string[]; render: () => string };
prasi: { page_id?: string };
}) => Promise<Response>;