Last active
December 25, 2016 03:44
-
-
Save vinnyoodles/576979b73ebfefce6de40681b219eb1f to your computer and use it in GitHub Desktop.
React Native Socket.io Initial Server
This file contains 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 express = require('express'); | |
var http = require('http') | |
var socketio = require('socket.io'); | |
var app = express(); | |
var server = http.Server(app); | |
var websocket = socketio(server); | |
server.listen(3000, () => console.log('listening on *:3000')); | |
// The event will be called when a client is connected. | |
websocket.on('connection', (socket) => { | |
console.log('A client just joined on', socket.id); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment