From 6add1fce8f6ec98ce273ba05b2f56df4b5cae878 Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 19 May 2017 11:50:44 +0000 Subject: push notifications working!! --- lib/okpush/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/okpush/index.js') diff --git a/lib/okpush/index.js b/lib/okpush/index.js index 36588aa..9ed64bc 100644 --- a/lib/okpush/index.js +++ b/lib/okpush/index.js @@ -109,7 +109,8 @@ function OKPush (options) { }) // should work without middleware - router.post('/add', bodyParser.urlencoded({ extended: false }), function (req, res) { + router.post('/add', bodyParser.json({}), function (req, res) { +console.log(req) db.addToken({ token: req.body.registrationId, channel: req.body.channel, @@ -118,7 +119,7 @@ function OKPush (options) { res.sendStatus(200) }) - router.post('/remove', bodyParser.urlencoded({ extended: false }), function (req, res) { + router.post('/remove', bodyParser.json({ extended: false }), function (req, res) { db.removeToken({ token: req.body.registrationId, channel: req.body.channel, -- cgit v1.2.3-70-g09d2