We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to figure out how to broadcast from an existing web application. The new version of a generated express application looks as follows...
app.js
app.get('/route', function(req, res){ req.io.broadcast('new visitor'); });
No dice this gives me a 404 so I try to move things into the routes\index.route file...
var express = require('express'); var router = express.Router(); ... router.get('/route', function(req, res){ req.io.broadcast('new visitor'); });
Still no dice this gives me an undefined exception. So what is the proper way for setting this up in Express 4? Currently does work in the app.js...
app.http().io(); app.io.route('ready', function(req) { req.io.emit('talk', { message: 'io event from an io route on the server' }) })
The text was updated successfully, but these errors were encountered:
+1 - this looks super useful, but def need Express 4+ support.
Sorry, something went wrong.
+1 - agreed. I've seen in other issue comments that techpines is working on Express 4 support as recently as July. Looking forward to that!
Yeah broadcast() wasn't working for me either, had to use emit(). Was it just renamed? The last time the broadcast example was modified was in 2012.
broadcast()
emit()
No branches or pull requests
I am trying to figure out how to broadcast from an existing web application. The new version of a generated express application looks as follows...
app.js
No dice this gives me a 404 so I try to move things into the routes\index.route file...
Still no dice this gives me an undefined exception. So what is the proper way for setting this up in Express 4? Currently does work in the app.js...
The text was updated successfully, but these errors were encountered: