Files
talk/middleware/pubsub.js
T
2018-01-11 20:00:34 -07:00

12 lines
308 B
JavaScript

const pubsub = require('../services/pubsub');
// To handle dependancy injection safer, we inject the pubsub handle onto the
// request object.
module.exports = (req, res, next) => {
// Attach the pubsub handle to the requests.
req.pubsub = pubsub.getClient();
// Forward on the request.
next();
};