Skip to content

Commit 55bf218

Browse files
committed
fix: add debug logging for 404 assets
1 parent 999e157 commit 55bf218

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,13 @@ export const sqliteAdmin = ({ dbPath, prefix = "/admin", configPath = "./sqlite-
245245
.get("/assets/*", async ({ params }) => {
246246
const filePath = join(uiPath, "assets", params["*"]);
247247
const file = Bun.file(filePath);
248-
if (!(await file.exists()))
249-
return new Response("Not found", { status: 404 });
248+
const exists = await file.exists();
249+
250+
if (!exists) {
251+
console.log(`[SQLite Admin] Asset not found: ${filePath}`);
252+
return new Response("Not found", { status: 404 });
253+
}
254+
250255
const ext = filePath.substring(filePath.lastIndexOf("."));
251256
return new Response(file, {
252257
headers: {

0 commit comments

Comments
 (0)