Update
This commit is contained in:
parent
255120b398
commit
a89c6d1de1
@ -23,7 +23,7 @@ var led_array = {
|
||||
|
||||
|
||||
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
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
responce.send({success: true, error: false})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
responce.send({ success: false, error: "NETWORK" })
|
||||
})
|
||||
.then(() => {
|
||||
responce.send({ success: true, error: false })
|
||||
})
|
||||
|
||||
}
|
||||
else {
|
||||
@ -62,7 +65,7 @@ app.post('/getlight', async function (request, responce) {
|
||||
brightness: led_array.brightness,
|
||||
color: led_array.color
|
||||
}
|
||||
responce.send({led_array: rsp})
|
||||
responce.send({ led_array: rsp })
|
||||
})
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user