summaryrefslogtreecommitdiff
path: root/WebInterface/NodeJSServer/src/server.js
blob: 13219732465285daef2968fb4824214a6b4117b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var express = require('express');
var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);

app.use('/ressources', express.static(__dirname + '/ressources/'));

app.get('/', function(req, res){
  res.sendFile(__dirname + '/index.html');
});
app.get('/index.css', function(req, res){
  res.sendFile(__dirname + '/index.css');
});
app.get('/index.js', function(req, res){
  res.sendFile(__dirname + '/index.js');
});

io.on('connection', function(socket){
  console.log('Connection: ' + socket);
});

http.listen(3000, function(){
  console.log('Listening on *:3000');
});