Here's what I have added to my app.js page. (using express generator)
app.js
var express = require('express');
var socket_io = require( "socket.io" );
var app = express();
// Socket.io
var io = socket_io();
app.io = io;
Now if I were to do the following:
io.on('connection', function (socket) {
console.log("connection made!");
});
This works nicely! But I'm wondering, how do I send socket_io to my route? For example I have a route called 'playground' and I would like to use socket_io specifically inside that route. I don't know how to do so! Any help would be great and I hope I was descriptive enough!