Added a test api
This commit is contained in:
parent
36458e50ec
commit
111fc0c85d
@ -11,15 +11,13 @@ const mqttClient = new mqtt.MqttApiClient("mqtt://localhost:1883");
|
||||
|
||||
mqttClient.start();
|
||||
|
||||
import * as sjson from "@common/sprinklers/json";
|
||||
import { autorun } from "mobx";
|
||||
const device = mqttClient.getDevice("grinklers");
|
||||
autorun(() => log.info("device: ", device.toString()));
|
||||
|
||||
import * as json from "@common/sprinklers/json";
|
||||
|
||||
app.get("/grinklers", (req, res) => {
|
||||
const j = json.sprinklersDeviceToJSON(device);
|
||||
console.dir(device);
|
||||
app.get("/api/grinklers", (req, res) => {
|
||||
const j = sjson.sprinklersDeviceToJSON(device);
|
||||
log.trace(j);
|
||||
res.send(j);
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user