API endpoint listing all icons in icons directory

This commit is contained in:
Neshura 2024-01-02 02:09:07 +01:00
parent 08282e07f0
commit ee5d6e947a
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);
}