Skip to content

Instantly share code, notes, and snippets.

@knyga
Created March 17, 2017 20:56
Show Gist options
  • Save knyga/3c2934e41babb3fe40e8254b0968b7e4 to your computer and use it in GitHub Desktop.
Save knyga/3c2934e41babb3fe40e8254b0968b7e4 to your computer and use it in GitHub Desktop.
const express = require(‘express’);
const app = express();
const http = require(‘http’).Server(app);
const io = require(‘socket.io’)(http);
// middleware for static processing
app.use(express.static(__dirname + ‘/static’));
// web socket connection event
io.on(‘connection’, function(socket){
console.log(‘connection’);
});
http.listen(3000, function(){
console.log(‘listening on *:3000’);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment