summaryrefslogtreecommitdiff
path: root/lib/okpush
diff options
context:
space:
mode:
Diffstat (limited to 'lib/okpush')
-rw-r--r--lib/okpush/index.js5
-rw-r--r--lib/okpush/package.json2
2 files changed, 4 insertions, 3 deletions
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,
diff --git a/lib/okpush/package.json b/lib/okpush/package.json
index 87ca92c..140a969 100644
--- a/lib/okpush/package.json
+++ b/lib/okpush/package.json
@@ -9,7 +9,7 @@
"author": "okfocus <frontdesk@okfoc.us>",
"license": "LNT",
"dependencies": {
- "apn": "^2.1.1",
+ "apn": "^2.1.4",
"bluebird": "^3.4.6",
"body-parser": "^1.15.2",
"lodash": "^4.16.3",