Add initial /servers route

This commit is contained in:
Neshura 2024-01-04 01:35:56 +01:00
parent 99679cc45b
commit abea3f1be9
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
7 changed files with 247 additions and 60 deletions
src/routes/data
servers
services

View file

@ -0,0 +1,10 @@
import * as fs from 'fs';
import { json } from '@sveltejs/kit';
export function GET() {
const content = fs.readFileSync('static/data/servers.json').toString();
const data = JSON.parse(content);
return json(data);
}

View file

@ -4,7 +4,7 @@ import { json } from '@sveltejs/kit';
export function GET() {
const content = fs.readFileSync('static/data/services.json').toString();
let data = JSON.parse(content);
const data = JSON.parse(content);
return json(data);
}