Fix directory EISDIR on root path, remove favicon
This commit is contained in:
@@ -3,7 +3,7 @@ import { cors } from "@elysiajs/cors";
|
|||||||
import { videoRoutes } from "./routes/videos";
|
import { videoRoutes } from "./routes/videos";
|
||||||
import { initDb } from "./services/db";
|
import { initDb } from "./services/db";
|
||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
import { existsSync } from "fs";
|
import { existsSync, statSync } from "fs";
|
||||||
|
|
||||||
initDb();
|
initDb();
|
||||||
|
|
||||||
@@ -25,7 +25,8 @@ const app = new Elysia()
|
|||||||
if (pathname.startsWith("/api")) return status(404, "Not found");
|
if (pathname.startsWith("/api")) return status(404, "Not found");
|
||||||
|
|
||||||
const filePath = join(STATIC_DIR, pathname);
|
const filePath = join(STATIC_DIR, pathname);
|
||||||
if (existsSync(filePath)) return Bun.file(filePath);
|
if (existsSync(filePath) && statSync(filePath).isFile())
|
||||||
|
return Bun.file(filePath);
|
||||||
|
|
||||||
const indexPath = join(STATIC_DIR, "index.html");
|
const indexPath = join(STATIC_DIR, "index.html");
|
||||||
if (existsSync(indexPath)) return Bun.file(indexPath);
|
if (existsSync(indexPath)) return Bun.file(indexPath);
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none">
|
|
||||||
<rect width="32" height="32" rx="6" fill="#0ea5e9"/>
|
|
||||||
<path d="M6 22 Q10 8 16 16 Q22 24 26 10" stroke="white" stroke-width="3" fill="none" stroke-linecap="round"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 247 B |
Reference in New Issue
Block a user