From 111fc0c85d75fc4fe9d8defd75c73bdd363b5b66 Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Wed, 4 Oct 2017 13:51:29 -0600 Subject: [PATCH] Added a test api --- server/index.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/server/index.ts b/server/index.ts index 2210c85..1ff3347 100644 --- a/server/index.ts +++ b/server/index.ts @@ -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); });