feat: Umstellung von CGI-Daten für analoge Eingänge von JS auf JSON
- CGI-Platzhalter in `analogInputs.json` eingeführt (z. B. <%=AAV01%>) - Alte JS-Datei ersetzt durch reine JSON-Struktur - Anpassung des Service-Handlers (`getAnalogInputsHandler.ts`) auf JSON-Parsing - Reduziert Ladezeit, vereinfacht Code und entfernt unnötige Script-Einbindung - Mock-Daten weiterhin in `analogInputsMockData.json` für Entwicklungsmodus verfügbar
This commit is contained in:
@@ -8,7 +8,7 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
const mode = process.env.NEXT_PUBLIC_CPL_MODE;
|
||||
|
||||
try {
|
||||
if (mode === "json") {
|
||||
/* if (mode === "json") {
|
||||
const filePath = path.join(
|
||||
process.cwd(),
|
||||
"mocks/api/SERVICE/analogInputsMockData.json"
|
||||
@@ -16,9 +16,9 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
const content = fs.readFileSync(filePath, "utf-8");
|
||||
const data = JSON.parse(content);
|
||||
return res.status(200).json(data);
|
||||
}
|
||||
} */
|
||||
|
||||
if (mode === "jsSimulatedProd") {
|
||||
if (mode === "json") {
|
||||
const filePath = path.join(
|
||||
process.cwd(),
|
||||
"mocks/device-cgi-simulator/SERVICE/analogInputsMockData.json"
|
||||
|
||||
Reference in New Issue
Block a user