Merge branch 'hotfix/21.56.9' into master
[gitter.git] / server / api / private / vapid.js
blob60b2a297b10fbaa491ba46f572a2223cd3b601b0
1 'use strict';
3 var logger = require('gitter-web-env').logger;
4 var pushNotificationService = require('gitter-web-push-notifications');
6 module.exports = function(req, res, next) {
7   var userId = req.user.id;
9   logger.info('Vapid registration', { userId: userId });
10   return pushNotificationService
11     .registerVapidSubscription(req.body, userId)
12     .then(function() {
13       res.status(204).end();
14     })
15     .catch(next);