- Mock-API-Endpunkte unter pages/api/mocks/webservice erstellt (JSON-basiert) - Zentrale Variable NEXT_PUBLIC_USE_MOCKS zur Modussteuerung eingeführt - fetchGis*-Services rufen je nach Modus reale oder Mockdaten ab - Alert-Hinweis im UI für aktive Mockumgebung eingebaut - .env.production sichert produktives Verhalten (Mocks deaktiviert) - mockData-Verzeichnis via .gitignore vom Repo ausgeschlossen - appVersion.js auf 1.1.231 erhöht
18 lines
502 B
JavaScript
18 lines
502 B
JavaScript
import fs from "fs";
|
|
import path from "path";
|
|
|
|
const filePath = path.join(process.cwd(), "mockData", "GisLinesStatus.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 GisLinesStatus.json" });
|
|
}
|
|
} else {
|
|
res.status(405).json({ error: "Methode nicht erlaubt" });
|
|
}
|
|
}
|