Try local react imports

This commit is contained in:
2026-03-31 06:22:26 +01:00
parent d6985b3335
commit 68d88bce4a
9 changed files with 191 additions and 69 deletions
+15 -11
View File
@@ -23,20 +23,24 @@ export default async function ({ req }: Params): Promise<Response> {
return new Response("Forbidden", { status: 403 });
}
if (!existsSync(file_path)) {
return new Response(`Public File Doesn't Exist`, {
status: 404,
});
}
const file = Bun.file(file_path);
let res_opts: ResponseInit = {};
return new Response(file, res_opts);
return readFileResponse({ file_path });
} catch (error) {
return new Response(`Public File Not Found`, {
status: 404,
});
}
}
export function readFileResponse({ file_path }: { file_path: string }) {
if (!existsSync(file_path)) {
return new Response(`Public File Doesn't Exist`, {
status: 404,
});
}
const file = Bun.file(file_path);
// let res_opts: ResponseInit = {};
return new Response(file);
}