diff options
| author | jules <jules@carbonpictures.com> | 2017-05-19 11:50:44 +0000 |
|---|---|---|
| committer | jules <jules@carbonpictures.com> | 2017-05-19 11:50:44 +0000 |
| commit | 6add1fce8f6ec98ce273ba05b2f56df4b5cae878 (patch) | |
| tree | ed018c206e54f244bf4c6f6bcb64d114250e3437 | |
| parent | 1b4bbdd157a6c5a47914b02915c7e6e84a73b573 (diff) | |
push notifications working!!
| -rw-r--r-- | db.json | 2 | ||||
| -rw-r--r-- | index.js | 5 | ||||
| -rw-r--r-- | lib/okpush/index.js | 5 | ||||
| -rw-r--r-- | lib/okpush/package.json | 2 |
4 files changed, 8 insertions, 6 deletions
@@ -2207,7 +2207,7 @@ { "id": "history-of-surveillance", "title": "History of Surveillance", - "body": "Spying and surveillance are as old as civilization itself. Our researchers have compiled a list of 100 milestones in the history of surveillance dating from pre-history to present day. \r\n\r\nExplore the entries by scrolling through the timeline. Click on each entry for more information. Entries are color coded into three categories: blue for surveillance, red for drones, and green for facial recognition software. \r\n\r\nIf you have an entry to suggest please feel free to send it to us via the <a href=\"/contact\">Contact Us</a> page.\r\n\r\nResearchers: \r\nBerit Gwendolyn Gilma and Hanno Hauenstein. \r\nSpecial thanks to Jacob Appelbaum who offered his expertise on the topic.", + "body": "Spying and surveillance are as old as civilization itself. Our researchers have compiled a list of 100 milestones in the history of surveillance dating from pre-history to present day.\r\n\r\nExplore the entries by scrolling through the timeline. Click on each entry for more information. Entries are color coded into three categories: blue for surveillance, red for drones, and green for facial recognition software. \r\n\r\nIf you have an entry to suggest please feel free to send it to us via the <a href=\"/contact\">Contact Us</a> page.\r\n\r\nResearchers: \r\nBerit Gwendolyn Gilma and Hanno Hauenstein. \r\nSpecial thanks to Jacob Appelbaum who offered his expertise on the topic.", "disabled": false, "__index": 6, "dateCreated": "Thu, 18 May 2017 00:16:34 GMT" @@ -1,7 +1,8 @@ var okcms = require('okcms') var path = require('path') -var isProduction = process.env.OK_PRODUCTION === 'true' var viewConfig = { template: 'index', +var isProduction = process.env.OK_PRODUCTION === 'true' +var viewConfig = { template: 'index', data: [ {type: 'timeline', query: '*'}, {type: 'page', query: '*'}, @@ -114,7 +115,7 @@ var app = okcms.createApp({ push: { lib: require("./lib/okpush"), mongodbUrl: "mongodb://localhost/okpush_hga", - 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"), 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", |
