Skip to content

Instantly share code, notes, and snippets.

@JT5D
Forked from eklimcz-zz/gist:9973c7b97d4930d827c9
Last active March 7, 2017 06:10
Show Gist options
  • Select an option

  • Save JT5D/b190cd5f25f01edbaa13 to your computer and use it in GitHub Desktop.

Select an option

Save JT5D/b190cd5f25f01edbaa13 to your computer and use it in GitHub Desktop.
basic node app for ble scanner
var express = require('express');
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var scanner = io.of('/scanner');
scanner.on('connection', function(socket) {
console.log('Scanner Connected');
socket.on('message', function(msg) {
//recived message from scanner
//do some processing here
});
socket.on('disconnect', function() {
console.log('Scanner Disconnected');
});
});
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