From c02d486a4fd8f5136c3277a31b9903204b5755a4 Mon Sep 17 00:00:00 2001 From: visocicaguy Date: Sun, 5 Aug 2018 16:25:07 +0200 Subject: [PATCH] Receiving push notifications --- api/controllers/push.js | 33 ++++++++++++++++++++++++++++++ assets/google65607aa129b18fc0.html | 1 + config/routes.js | 4 +++- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 api/controllers/push.js create mode 100644 assets/google65607aa129b18fc0.html diff --git a/api/controllers/push.js b/api/controllers/push.js new file mode 100644 index 0000000..09add0b --- /dev/null +++ b/api/controllers/push.js @@ -0,0 +1,33 @@ +module.exports = { + + + friendlyName: 'Push Notification', + + + description: 'Notify.', + + + inputs: { + message: { + type: 'json' + } + }, + + + exits: { + + }, + + + fn: async function (inputs, exits) { + + if (inputs.message) + console.log(inputs.message); + else console.log("No message specified"); + + return exits.success({ url: "//hamo.com" }); + + } + + +}; diff --git a/assets/google65607aa129b18fc0.html b/assets/google65607aa129b18fc0.html new file mode 100644 index 0000000..dcc02cb --- /dev/null +++ b/assets/google65607aa129b18fc0.html @@ -0,0 +1 @@ +google-site-verification: google65607aa129b18fc0.html \ No newline at end of file diff --git a/config/routes.js b/config/routes.js index 9e5fac7..9e3ed2c 100644 --- a/config/routes.js +++ b/config/routes.js @@ -38,7 +38,9 @@ module.exports.routes = { * not match any of those, it is matched against static assets. * * * ***************************************************************************/ - + '/pushnotifications': { + action: 'push' + }, // ╔═╗╔═╗╦ ╔═╗╔╗╔╔╦╗╔═╗╔═╗╦╔╗╔╔╦╗╔═╗ // ╠═╣╠═╝║ ║╣ ║║║ ║║╠═╝║ ║║║║║ ║ ╚═╗