Add nix flake to repo (#1111)

This commit is contained in:
Rory&
2024-02-19 21:09:50 +11:00
committed by GitHub
parent 3eb5a3f420
commit 29df169c81
21 changed files with 433 additions and 295 deletions
+18 -2
View File
@@ -63,7 +63,15 @@ router.get("/avatars/:id", async (req: Request, res: Response) => {
id = id.split(".")[0]; // remove .file extension
const hash = defaultAvatarHashMap.get(id);
if (!hash) throw new HTTPError("not found", 404);
const path = join(process.cwd(), "assets", "public", `${hash}.png`);
const path = join(
__dirname,
"..",
"..",
"..",
"assets",
"public",
`${hash}.png`,
);
const file = await getFile(path);
if (!file) throw new HTTPError("not found", 404);
@@ -80,7 +88,15 @@ router.get("/group-avatars/:id", async (req: Request, res: Response) => {
id = id.split(".")[0]; // remove .file extension
const hash = defaultGroupDMAvatarHashMap.get(id);
if (!hash) throw new HTTPError("not found", 404);
const path = join(process.cwd(), "assets", "public", `${hash}.png`);
const path = join(
__dirname,
"..",
"..",
"..",
"assets",
"public",
`${hash}.png`,
);
const file = await getFile(path);
if (!file) throw new HTTPError("not found", 404);