<commit_before>var http = require('http');
var express = require("express");
var app = express();
var bodyParser = require('body-parser');

var listener = 8080;

var server = http.createServer(app);
server.listen(listener);

var path = require("path");

/********** LE SERVEUR **********/

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

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

app.use(bodyParser.json()); // parse application/json
app.use(bodyParser.urlencoded({
    extended: true
}));

/* MONGODB */

var mongodb = require('mongodb');

//We need to work with "MongoClient" interface in order to connect to a mongodb server.
var MongoClient = mongodb.MongoClient;

// Connection URL. This is where your mongodb server is running.
var serverName = process.env.SERVERNAME;
var portListener = process.env.PORTMONGODB;
var bdd = process.env.BDD;
    

/*var serverName ="localhost";
var portListener = "27017";
var bdd = "quiz";*/

var url = 'mongodb://'+serverName+':'+portListener+'/'+bdd;
//var url = 'mongodb://localhost:27017/quiz';<commit_msg>update (serveur.js): Connexion en localhost quand variables d'environnements non définies<commit_after>var http = require('http');
var express = require("express");
var app = express();
var bodyParser = require('body-parser');

var listener = 8080;

var server = http.createServer(app);
server.listen(listener);

var path = require("path");

/********** LE SERVEUR **********/

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

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

app.use(bodyParser.json()); // parse application/json
app.use(bodyParser.urlencoded({
    extended: true
}));

/* MONGODB */

var mongodb = require('mongodb');

//We need to work with "MongoClient" interface in order to connect to a mongodb server.
var MongoClient = mongodb.MongoClient;
    
if(process.env.SERVERNAME)
    serverName = process.env.SERVERNAME;
else
    serverName = "localhost";
    
if(process.env.PORTMONGODB)
    portListener = process.env.PORTMONGODB;
else
    portListener = "27017";
    
if(process.env.BDDNAME)
    bdd = process.env.BDDNAME;
else
    bdd = "quiz";



/*var serverName ="localhost";
var portListener = "27017";
var bdd = "quiz";*/

var url = 'mongodb://'+serverName+':'+portListener+'/'+bdd;
//var url = 'mongodb://localhost:27017/quiz';
{'fraction_non_alphanumeric': 0.17767558528428093, 'fraction_numerical': 0.013795986622073578, 'mean_word_length': 4.501149425287356, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2720793', 'n_tokens_mistral': 821, 'n_tokens_neox': 784, 'n_words': 193}