Add initial /servers route
This commit is contained in:
parent
99679cc45b
commit
abea3f1be9
7 changed files with 247 additions and 60 deletions
src/routes/data
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue