Created
July 15, 2015 15:27
-
-
Save MickaelCruzDB/a347039a15c8960c8aed to your computer and use it in GitHub Desktop.
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 http = require('http'); | |
var express=require('express'); | |
var net = require ('net'); | |
var app = express(); | |
app.use(express.static(__dirname + '/public')); | |
/* LISTE DE TOUTES LES COMMANDES ICI LIEES AU VIDEODATA.TXT */ | |
var commands = { | |
MAFU1: "MAFU1\n" | |
}; | |
/* FIN LISTE DE TOUTES LES COMMANDES */ | |
var client = net.connect(7777, '192.168.1.13', function() { | |
console.log('Connected with iPhone'); /* ON DIT BONJOUR MONSIEUR */ | |
/* PRODUCTS */ | |
app.post('/MAFU1', function(req, res){ | |
client.write(commands.MAFU1); /* ON ENVOI LA SEQUENCE DEFINIE DANS VIDEODATA.TXT */ | |
console.log("Command sent"); | |
}); | |
/* END INDEX */ | |
}); | |
app.listen(7777); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment