v12.0.0 - initial commit
This commit is contained in:
commit
e2c49ea43c
1145 changed files with 97211 additions and 0 deletions
16
packages/server/lib/routes/stateRoutes.js
Normal file
16
packages/server/lib/routes/stateRoutes.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
const express = require('express')
|
||||
const router = express.Router()
|
||||
|
||||
const helpers = require('../route-helpers')
|
||||
const respond = require('../respond')
|
||||
|
||||
function stateChange(req, res, next) {
|
||||
helpers
|
||||
.stateChange(req.deviceId, req.deviceTime, req.body)
|
||||
.then(() => respond(req, res))
|
||||
.catch(next)
|
||||
}
|
||||
|
||||
router.post('/', stateChange)
|
||||
|
||||
module.exports = router
|
||||
Loading…
Add table
Add a link
Reference in a new issue