Skip to content

Instantly share code, notes, and snippets.

@manuquentin
Last active December 20, 2015 00:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save manuquentin/6042754 to your computer and use it in GitHub Desktop.
Save manuquentin/6042754 to your computer and use it in GitHub Desktop.
var app = require('express')();
var http = require('http');
var server = http.createServer(app);
var io = require('socket.io').listen(server, { log: false })
app.post('/door-open', function (req, res) {
});
app.post('/detect', function (req, res) {
});
io.on('connection',function(socket){
currentSocket = socket;
});
io.on('disconnect',function(socket){
currentSocket = null;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment