This commit is contained in:
Max 2020-10-08 12:13:00 +01:00
parent 255120b398
commit a89c6d1de1

View File

@ -23,7 +23,7 @@ var led_array = {
app.get('/', function (request, responce) { app.get('/', function (request, responce) {
responce.render('index.ejs', {led_array:led_array}) responce.render('index.ejs', { led_array: led_array })
}) })
@ -44,10 +44,13 @@ app.post('/setlight', async function (request, responce) {
color: led_array.color color: led_array.color
} }
}) })
.catch((err) => { .catch((err) => {
console.error(err) console.error(err)
}) responce.send({ success: false, error: "NETWORK" })
responce.send({success: true, error: false}) })
.then(() => {
responce.send({ success: true, error: false })
})
} }
else { else {
@ -62,7 +65,7 @@ app.post('/getlight', async function (request, responce) {
brightness: led_array.brightness, brightness: led_array.brightness,
color: led_array.color color: led_array.color
} }
responce.send({led_array: rsp}) responce.send({ led_array: rsp })
}) })