How to emit from server side file so other server side file perform actions? #4756
-
I want to be able to emit from a server side file to the app.js file (also server side) so it perform some operations with variables only available in that file but I cant seem to do it. ` //app.js const io = require("socket.io")(server, {maxHttpBufferSize: 1e20, pingTimeout: 60000}); exports.io = io; io.on("connection", socket => { //vales.js const io = require('../app').io; io.sockets.emit('Refresh', data) ` |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi! This does not seem related to Socket.IO. Please use StackOverflow for JavaScript-related questions. |
Beta Was this translation helpful? Give feedback.
Hi! This does not seem related to Socket.IO. Please use StackOverflow for JavaScript-related questions.