API endpoint listing all icons in icons directory

This commit is contained in:
Neshura 2024-01-02 02:09:07 +01:00
parent e4cce6239d
commit b4f295bf46
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C

View file

@ -0,0 +1,10 @@
import * as fs from "fs";
import {json} from "@sveltejs/kit";
export function GET() {
let content = fs.readdirSync("static/assets/icons");
content = content.filter((entry) => entry != ".directory")
return json(content);
}