22 lines
670 B
JavaScript
22 lines
670 B
JavaScript
const post = require('../lib/post')
|
|
|
|
module.exports = function (app) {
|
|
app.get("/water", async function (req, res, next) {
|
|
const response = await post.postRequest()
|
|
const water = response.updateData.zones[1]
|
|
res.json(water)
|
|
});
|
|
|
|
app.get("/water/status", async function (req, res, next) {
|
|
const response = await post.postRequest()
|
|
const water = response.updateData.zones[1].status
|
|
res.json(water)
|
|
});
|
|
|
|
app.get("/water/config", async function (req, res, next) {
|
|
const response = await post.postRequest()
|
|
const water = response.updateData.zones[1].config
|
|
res.json(water)
|
|
});
|
|
|
|
} |