- Chart zeigt jetzt zusätzlich zu Messwert auch Minimal-, Maximal- und Durchschnittswerte an - Datenstruktur an Redux angepasst (i, a, g) - Darstellung entspricht jetzt LoopMeasurementChart
24 lines
672 B
TypeScript
24 lines
672 B
TypeScript
// /pages/api/cpl/getAnalogInputsHandler.ts
|
|
|
|
import { NextApiRequest, NextApiResponse } from "next";
|
|
import fs from "fs";
|
|
import path from "path";
|
|
|
|
export default function handler(req: NextApiRequest, res: NextApiResponse) {
|
|
const mode = process.env.NEXT_PUBLIC_CPL_MODE;
|
|
|
|
try {
|
|
const filePath = path.join(
|
|
process.cwd(),
|
|
"mocks/device-cgi-simulator/SERVICE/analogInputsMockData.json"
|
|
);
|
|
const jsonContent = fs.readFileSync(filePath, "utf-8");
|
|
const data = JSON.parse(jsonContent);
|
|
res.status(200).json(data);
|
|
return;
|
|
} catch (error) {
|
|
console.error(error);
|
|
res.status(500).json({ error: "Internal Server Error" });
|
|
}
|
|
}
|