Merge branch 'v5' into v5
This commit is contained in:
commit
d254e28e96
15 changed files with 2223 additions and 1468 deletions
|
|
@ -15,6 +15,7 @@ const plugins = require('./plugins')
|
|||
const helpers = require('./route-helpers')
|
||||
const poller = require('./poller')
|
||||
const Tx = require('./tx')
|
||||
const E = require('./error')
|
||||
const customers = require('./customers')
|
||||
|
||||
const argv = require('minimist')(process.argv.slice(2))
|
||||
|
|
@ -109,6 +110,10 @@ function postTx (req, res, next) {
|
|||
|
||||
return res.json(tx)
|
||||
})
|
||||
.catch(err => {
|
||||
if (err instanceof E.StaleTxError) return res.status(404).json({})
|
||||
throw err
|
||||
})
|
||||
.catch(next)
|
||||
}
|
||||
|
||||
|
|
@ -289,7 +294,11 @@ app.get('/tx/:id', getTx)
|
|||
app.get('/tx', getPhoneTx)
|
||||
|
||||
app.use(errorHandler)
|
||||
app.use((req, res) => res.status(404).json({error: 'No such route'}))
|
||||
app.use((req, res) => {
|
||||
console.log('DEBUG98')
|
||||
console.log(req.route)
|
||||
res.status(404).json({error: 'No such route'})
|
||||
})
|
||||
|
||||
localApp.get('/pid', (req, res) => {
|
||||
const deviceId = req.query.device_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue