Commit 1f101f0d authored by Janik Münzenberger's avatar Janik Münzenberger
Browse files

Added api receive route

parent e6a75e46
......@@ -85,7 +85,7 @@ function getOptionsFromRequest(req, imagePath, imageName) {
},
formData: {
crop_id: req.body.crop_id,
notification_url: req.body.notification_url || config.base_url,
notification_url: config.base_url + "/api/notifications/result",
notification_email: req.body.notification_email,
//notification_token: req.body.notification_token,
device_type: req.body.device_type || 'android',
......
......@@ -26,6 +26,14 @@ function postNotification (req, res) {
});
}
function receiveFromApi(req, res){
console.req(req.params);
console.log(req.query);
console.log(req.body);
res.send();
}
module.exports = {
postNotification: postNotification,
postNotification,
receiveFromApi
};
......@@ -24,7 +24,8 @@ router.get('/gardeners', gardenerController.getGardeners);
router.get('/gardeners/:id', gardenerController.getGardener);
router.post('/gardeners', gardenerController.postGardener);
router.post('/notification', notificationController.postNotification);
router.post('/notificaions/result', notificationController.receiveFromApi);
router.post('/notifications', notificationController.postNotification);
router.post('/email', middleware.checkBody(["sender", "receiver", "subject", "message"]), emailController.email);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment