import fs from "fs";
import path from "path";

const filePath = path.join(process.cwd(), "mockData", "GisSystemStatic.json");

export default function handler(req, res) {
  if (req.method === "GET") {
    try {
      const data = fs.readFileSync(filePath, "utf-8");
      res.status(200).json(JSON.parse(data));
    } catch (error) {
      res.status(500).json({ error: "Fehler beim Lesen der GisSystemStatic.json" });
    }
  } else {
    res.status(405).json({ error: "Methode nicht erlaubt" });
  }
}
