Emitting from a endpoint
DarrylD opened this issue · comments
Darryl D. commented
When the client hits an endpoint, trying to do something like so
var router = require('koa-router')();
router.get('/test', function *(next) {
//this.brodcast?
this.body = dostuff();
})
Is this possible? Want to send messages to clients when endpoints are hit.
Charlike Mike Reagent commented
@DarrylD heya! Sorry for the delay.
Is this possible?
Yea, I believe you can access do this.io.broadcast
, because we have this.io
in the app instance.