PFP placeholder
This commit is contained in:
parent
554297e872
commit
4c75756abc
3 changed files with 102 additions and 1 deletions
|
@ -17,7 +17,11 @@ export async function GET({ url, cookies, params }) {
|
|||
|
||||
if (FILE_DIRS.indexOf(dir) == -1) dir = FILE_DIRS[0];
|
||||
|
||||
var res = await readFile(`${process.cwd()}/db/files/${dir}/${imgName}`);
|
||||
var res;
|
||||
|
||||
res = await readFile(`${process.cwd()}/db/files/${dir}/${imgName}`).catch(() => {});
|
||||
|
||||
if (!res && dir == 'pfp') res = await readFile(`${process.cwd()}/static/pfp.png`);
|
||||
|
||||
var response = new Response(res);
|
||||
var extension = imgName.split('.').pop();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue