mirror of
https://github.com/wassname/talk.git
synced 2026-06-28 22:38:29 +08:00
13 lines
309 B
JavaScript
13 lines
309 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();
|
|
};
|