Browse Source

qsdjklghqsfgdsgjkhdsgjlmkdfhg

Brendan Abolivier 9 years ago
parent
commit
c22cdd1c7b
2 changed files with 4 additions and 2 deletions
  1. 3
    2
      web/multi/server/server.js
  2. 1
    0
      web/params.cfg

+ 3
- 2
web/multi/server/server.js View File

1
 var io = require('socket.io'); // Chargement du module pour mettre en place les websockets
1
 var io = require('socket.io'); // Chargement du module pour mettre en place les websockets
2
 var http = require('http');
2
 var http = require('http');
3
 var fs = require('fs'), cfgFilePath = '';
3
 var fs = require('fs'), cfgFilePath = '';
4
-var httpHost = 'localhost', httpPath = '/burger-quizz/web/api/';
4
+var httpHost = 'localhost', httpPath = '/burger-quizz/web/api/', nodePort = 8000;
5
 
5
 
6
 // Lecture du fichier de configuration
6
 // Lecture du fichier de configuration
7
 if(process.argv.length > 2) {
7
 if(process.argv.length > 2) {
14
 
14
 
15
 var httpHost = params.match(/http_host: (.+)/)[1];
15
 var httpHost = params.match(/http_host: (.+)/)[1];
16
 var httpPath = params.match(/http_path: (.+)/)[1];
16
 var httpPath = params.match(/http_path: (.+)/)[1];
17
+var nodePort = params.match(/node_port: (.+)/)[1];
17
 
18
 
18
 console.log("Serveur initialisé sur l'URL "+httpHost+httpPath);
19
 console.log("Serveur initialisé sur l'URL "+httpHost+httpPath);
19
 
20
 
121
 // Initialisation
122
 // Initialisation
122
 function init() {
123
 function init() {
123
     // Le server temps réel écoute sur le port 8000
124
     // Le server temps réel écoute sur le port 8000
124
-    server = io.listen(8000);
125
+    server = io.listen(nodePort);
125
 
126
 
126
     // Gestion des évènements
127
     // Gestion des évènements
127
     setEventHandlers();
128
     setEventHandlers();

+ 1
- 0
web/params.cfg View File

1
 http_host: localhost
1
 http_host: localhost
2
 http_path: /burger-quizz/web/
2
 http_path: /burger-quizz/web/
3
 node_host: 149.91.82.239
3
 node_host: 149.91.82.239
4
+node_port: 8000
4
 db_host: localhost
5
 db_host: localhost
5
 db_dbname: burgerquizz
6
 db_dbname: burgerquizz
6
 db_user: alain
7
 db_user: alain