update for express 4
This commit is contained in:
parent
f0994fd9a7
commit
6b58b88bfb
1 changed files with 6 additions and 6 deletions
|
|
@ -114,14 +114,14 @@ function trade (req, res) {
|
||||||
plugins.trade(session(req), tx, function (err) {
|
plugins.trade(session(req), tx, function (err) {
|
||||||
if (err) logger.error(err)
|
if (err) logger.error(err)
|
||||||
var statusCode = err ? 500 : 201
|
var statusCode = err ? 500 : 201
|
||||||
res.json(statusCode, {err: err})
|
res.status(statusCode).json({err: err})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function stateChange (req, res) {
|
function stateChange (req, res) {
|
||||||
plugins.stateChange(session(req), req.body, function (err) {
|
plugins.stateChange(session(req), req.body, function (err) {
|
||||||
if (err) console.error(err)
|
if (err) console.error(err)
|
||||||
res.json(200)
|
res.json({success: true})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -160,7 +160,7 @@ function cashOut (req, res) {
|
||||||
|
|
||||||
function dispenseAck (req, res) {
|
function dispenseAck (req, res) {
|
||||||
plugins.dispenseAck(session(req), req.body)
|
plugins.dispenseAck(session(req), req.body)
|
||||||
res.json(200)
|
res.json({success: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
function deviceEvent (req, res) {
|
function deviceEvent (req, res) {
|
||||||
|
|
@ -203,9 +203,9 @@ function pair (req, res) {
|
||||||
getFingerprint(req),
|
getFingerprint(req),
|
||||||
name,
|
name,
|
||||||
function (err) {
|
function (err) {
|
||||||
if (err) return res.json(500, { err: err.message })
|
if (err) return res.send(500).json({ err: err.message })
|
||||||
|
|
||||||
res.json(200)
|
res.json({success: true})
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -325,7 +325,7 @@ function init (localConfig) {
|
||||||
}
|
}
|
||||||
|
|
||||||
reboots[fingerprint] = pid
|
reboots[fingerprint] = pid
|
||||||
res.sendStatus(200)
|
res.sendStatus({success: true})
|
||||||
})
|
})
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue