Skip to content

Instantly share code, notes, and snippets.

@LiamDotPro
Created March 15, 2017 09:22
Show Gist options
  • Save LiamDotPro/a024d6168723a771002c528d3ab626f7 to your computer and use it in GitHub Desktop.
Save LiamDotPro/a024d6168723a771002c528d3ab626f7 to your computer and use it in GitHub Desktop.
var express = require('express');
var app = require('express')();
var server = require('http').createServer(app);
var io = require('socket.io')(server);
server.listen(80, function () {
console.log('Server Started');
});
server.listen(80);
//make the public resources static
app.use(express.static(__dirname + '/'));
app.get('/', function (req, res) {
res.sendFile(path.join(__dirname + '/public/index.html'));
//console.log('express serves homepage');
});
//users will be added here
var users = new Map();
io.on('connection', function (socket) {
socket.on('disconnect', function (){
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment