git commit -m "feat: Mock-API über /api/mockData/webService erfolgreich implementiert 🚀
- JSON-Dateien aus /webServiceMockdata als echte API-Mocks verfügbar - API-Endpunkte unter /api/mockData/webService/ hinzugefügt - Fehlerhafte Platzhalter in den API-Handlern korrigiert - Alle Mock-URLs in config.js auf die neuen API-Routen umgestellt - Tests erfolgreich durchgeführt, Mock-API funktioniert einwandfrei"
This commit is contained in:
15
pages/api/mockData/webService/GetIconsStaticMock.js
Normal file
15
pages/api/mockData/webService/GetIconsStaticMock.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
export default function handler(req, res) {
|
||||
const filePath = path.join(process.cwd(), "webServiceMockdata", "GetIconsStaticMock.json");
|
||||
|
||||
try {
|
||||
const fileContent = fs.readFileSync(filePath, "utf8");
|
||||
const data = JSON.parse(fileContent);
|
||||
res.status(200).json(data);
|
||||
} catch (error) {
|
||||
console.error(`Error reading GetIconsStaticMock.json:`, error);
|
||||
res.status(500).json({ message: "Error loading mock data" });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user