Last active
January 4, 2016 20:19
-
-
Save zgramana/8673162 to your computer and use it in GitHub Desktop.
Test Node + Express server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl http://localhost:3000/socket.io/1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = require('express')(); | |
var server = require('http').Server(app); | |
var io = require('socket.io').listen(server); | |
io.on('connection', function(socket){ | |
console.log("woo hoo"); | |
socket.on('event', function(data){}); | |
socket.on('disconnect', function(){}); | |
}); | |
server.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment