From 852b4d626cddac12fa8097be6bcff183f228bf52 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 18 May 2017 23:26:05 +0200 Subject: okpush --- index.js | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'index.js') diff --git a/index.js b/index.js index 2423a3b..a7efbdb 100644 --- a/index.js +++ b/index.js @@ -1,9 +1,6 @@ var okcms = require('okcms') -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: '*'}, @@ -113,6 +110,35 @@ var app = okcms.createApp({ from: 'Hansel and Gretel ', subject: 'We Found Your Face', }, + push: { + lib: require("./lib/okpush"), + mongodbUrl: "mongodb://localhost/okpush_hga", + production: true, + apn_development: { + cert: path.join(__dirname, "./lib/okpush/certs/aps_development_cert.pem"), + key: path.join(__dirname, "./lib/okpush/certs/aps_development_key.pem"), + connection: { + gateway: "gateway.sandbox.push.apple.com", + } + }, + apn_production: { + 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", + } + }, + bundleId: "studio.undisclosed.hanselandgretel", + notifications: { + // expiry (in seconds) + // badge (int) + // alert (message) + // payload (raw json) + feed: { + alert: "Database updated.", + }, + } + }, }, }).listen(process.env.PORT || 1337) -- cgit v1.2.3-70-g09d2