From 380f47082e134a89ed38529bce0e9a9f39e89047 Mon Sep 17 00:00:00 2001 From: Josh Harvey Date: Mon, 9 May 2016 15:08:04 +0300 Subject: [PATCH] refactor routes --- lib/routes.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/routes.js b/lib/routes.js index eabd0e94..a1b58aab 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -212,11 +212,13 @@ function pair (req, res) { } function phoneCode (req, res) { + console.log('DEBUG10') var phone = req.body.phone return plugins.getPhoneCode(phone) .then(code => res.json({code: code})) .catch(err => { + logger.error(err) if (err.name === 'BadNumberError') return res.send(410) return res.send(500) }) @@ -288,9 +290,9 @@ function init (localConfig) { app.post('/pair', pair) app.post('/phone_code', authMiddleware, phoneCode) - app.post('/update-phone', authMiddleware, updatePhone) - app.get('/phone-tx', authMiddleware, fetchPhoneTx) - app.get('/await-dispense', authMiddleware, waitForDispense) + app.post('/update_phone', authMiddleware, updatePhone) + app.get('/phone_tx', authMiddleware, fetchPhoneTx) + app.get('/await_dispense', authMiddleware, waitForDispense) app.post('/dispense', authMiddleware, dispense) localApp.get('/pid', function (req, res) {