allow custom css

This commit is contained in:
KingKDot
2026-03-25 09:50:41 -05:00
parent 66fdf578b7
commit 7b5037bc18
7 changed files with 181 additions and 1 deletions
@@ -1,4 +1,5 @@
import path from "path";
import { getConfig } from "../../config";
type AssetsRouteDeps = {
PUBLIC_ROOT: string;
@@ -11,6 +12,16 @@ export async function handleAssetsRoutes(
url: URL,
deps: AssetsRouteDeps,
): Promise<Response | null> {
if (req.method === "GET" && url.pathname === "/assets/custom.css") {
const css = getConfig().appearance?.customCSS || "";
return new Response(css, {
headers: {
"Content-Type": "text/css; charset=utf-8",
"Cache-Control": "no-cache",
},
});
}
if (req.method === "GET" && url.pathname === "/favicon.ico") {
const file = Bun.file(path.join(deps.PUBLIC_ROOT, "assets", "favicon.ico"));
if (await file.exists()) {