Ver código fonte

Mettre à jour 'server/src/index.js'

Gregoire Thomas 4 anos atrás
pai
commit
fea138a6b5
1 arquivos alterados com 2 adições e 8 exclusões
  1. 2 8
      server/src/index.js

+ 2 - 8
server/src/index.js

@@ -12,9 +12,6 @@
   
     var fs = require('fs');
 
-
-// server.js
-//require('dotenv').config({path:'/home/gregoire/Documents/MyWebProject/.env'});
 require('dotenv').config({path:'/data/.env'});
 
 const Client_ip = process.env.Client_ip;
@@ -22,7 +19,7 @@ const Client_ip = process.env.Client_ip;
     const PORT = process.env.Server_port;
 
     var files = fs.readdirSync('/data/vtis/');
-    //var files = fs.readdirSync('./datas/');
+   
     var options = '';
 
     for (var i in files) {
@@ -34,7 +31,7 @@ const Client_ip = process.env.Client_ip;
 
 
     var fileName = '/data/controller.html';
-    //var fileName = '/home/gregoire/Documents/controller2.html';
+  
     var stream = fs.createWriteStream(fileName);
 
     app.use(cors())
@@ -49,8 +46,6 @@ const Client_ip = process.env.Client_ip;
       '    a { color: black; text-decoration: none;}</style>';
       var body = '<div id="root"></div><IMG SRC="https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Logo_KIT.svg/1200px-Logo_KIT.svg.png" WIDTH=55 HEIGHT=30><p>Select dataset:</p>' +  '' + options;
 
-      // concatenate header string
-      // concatenate body string
 
       return '<!DOCTYPE html>'
            + '<html><head>' + header + '</head><body>' + body + '</body></html>';
@@ -62,7 +57,6 @@ const Client_ip = process.env.Client_ip;
       stream.end(html);
     });
 
-    //app.use(express.static('datas'));
     app.use(express.static('data'));
 
     app.listen(PORT, () => {