Nuxt is based on Vue.js and I find their building blocks to be much neater compared to the React based Next.js.
6 lines
228 B
TypeScript
6 lines
228 B
TypeScript
import { readFile } from "node:fs/promises";
|
|
import { Schedule } from "~/shared/types/schedule";
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
return JSON.parse(await readFile("schedule.json", "utf-8")) as Schedule;
|
|
})
|