Feat: refactor routes.js express entrypoint config
Feat: express config script refactor Feat: add state and settingsCache files
This commit is contained in:
parent
c3f8f98c26
commit
85235eaa13
22 changed files with 807 additions and 1 deletions
14
lib/routes/stateRoutes.js
Normal file
14
lib/routes/stateRoutes.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
const express = require('express')
|
||||
const router = express.Router()
|
||||
|
||||
const helpers = require('../route-helpers')
|
||||
|
||||
function stateChange (req, res, next) {
|
||||
helpers.stateChange(req.deviceId, req.deviceTime, req.body)
|
||||
.then(() => res.status(200).json({}))
|
||||
.catch(next)
|
||||
}
|
||||
|
||||
router.post('/', stateChange)
|
||||
|
||||
module.exports = router
|
||||
Loading…
Add table
Add a link
Reference in a new issue