-
-
Save JT5D/b190cd5f25f01edbaa13 to your computer and use it in GitHub Desktop.
basic node app for ble scanner
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 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