API endpoint listing all icons in icons directory
This commit is contained in:
parent
08282e07f0
commit
ee5d6e947a
1 changed files with 10 additions and 0 deletions
10
src/routes/assets/icons/+server.ts
Normal file
10
src/routes/assets/icons/+server.ts
Normal 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);
|
||||
}
|
Loading…
Reference in a new issue