API endpoint returning /data/services.json
This commit is contained in:
parent
ee5d6e947a
commit
7f25f40fe6
1 changed files with 10 additions and 0 deletions
10
src/routes/data/services/+server.ts
Normal file
10
src/routes/data/services/+server.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import * as fs from "fs";
|
||||||
|
import {json} from "@sveltejs/kit";
|
||||||
|
|
||||||
|
export function GET() {
|
||||||
|
const content = fs.readFileSync("static/data/services.json").toString();
|
||||||
|
|
||||||
|
let data = JSON.parse(content)
|
||||||
|
|
||||||
|
return json(data);
|
||||||
|
}
|
Loading…
Reference in a new issue