From f8257aa6ab3158a328825345a9c0440649b2e791 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 23 Sep 2017 20:20:26 +0200 Subject: put in dev mode for a moment --- index.js | 8 ++++---- lib/okpush/index.js | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index e2b0a6f4..663faeeb 100644 --- a/index.js +++ b/index.js @@ -85,7 +85,7 @@ var app = okcms.createApp({ push: { lib: require("./lib/okpush"), mongodbUrl: "mongodb://localhost/okpush_stone", - production: true, + production: false, apn_development: { cert: path.join(__dirname, "./lib/okpush/certs/aps_development_cert.pem"), key: path.join(__dirname, "./lib/okpush/certs/aps_development_key.pem"), @@ -94,10 +94,10 @@ var app = okcms.createApp({ } }, apn_production: { - cert: path.join(__dirname, "./lib/okpush/certs/aps_production_cert.pem"), - key: path.join(__dirname, "./lib/okpush/certs/aps_production_key.pem"), + // cert: path.join(__dirname, "./lib/okpush/certs/aps_production_cert.pem"), + // key: path.join(__dirname, "./lib/okpush/certs/aps_production_key.pem"), connection: { - gateway: "gateway.push.apple.com", + // gateway: "gateway.push.apple.com", } }, bundleId: "us.okfoc.stoneisland", diff --git a/lib/okpush/index.js b/lib/okpush/index.js index 391f64f9..9ad6307a 100644 --- a/lib/okpush/index.js +++ b/lib/okpush/index.js @@ -118,6 +118,9 @@ function OKPush (options) { router.post('/custom', bodyParser.urlencoded({ extended: false }), function (req, res) { var message = req.body.message var url = req.body.url + if (! message || ! url) { + return res.sendStatus(500) + } var opt = { alert: message, payload: { 'url': url }, -- cgit v1.2.3-70-g09d2