<commit_before>var express = require('express');
var path = require('path');
var http = require('http');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var passport = require('passport');

var LocalStrategy = require('passport-local').Strategy;


require('./model/events/schemas/event.schema');
require('./model/mongo_connection');
require('./model/account/schemas/user');
require('./model/instances/schemas/workshop-instance.schema');
require('./model/catalogue/schemas/workshop');
var pass = require('./configurations/pass');
var auth = require('./routes/auth');
var users = require('./routes/users');
var catalogue = require('./routes/catalogue');
var feedback = require('./routes/feedback');
var cloudinaryUploader = require('./routes/cloudinaryUploader');
var dbCleaner = require('./routes/db.dev');
var app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');


app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public/')));

app.use(function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "http://localhost:8100");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    res.header("Access-Control-Allow-Credentials", true);
    res.header("Access-Control-Allow-Methods","PUT, GET, POST, DELETE, OPTIONS");
    next();
});
// required for passport
app.use(require('express-session')({
    secret: 'MEAN',
    resave: false,
    saveUninitialized: false
})); // session secret
app.use(passport.initialize());
app.use(passport.session()); // persistent login sessions<commit_msg>Ajout de mon adresse ip pour lancer l'application tablette depuis un autre ordinateur afin de record la vidéo<commit_after>var express = require('express');
var path = require('path');
var http = require('http');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var passport = require('passport');

var LocalStrategy = require('passport-local').Strategy;


require('./model/events/schemas/event.schema');
require('./model/mongo_connection');
require('./model/account/schemas/user');
require('./model/instances/schemas/workshop-instance.schema');
require('./model/catalogue/schemas/workshop');
var pass = require('./configurations/pass');
var auth = require('./routes/auth');
var users = require('./routes/users');
var catalogue = require('./routes/catalogue');
var feedback = require('./routes/feedback');
var cloudinaryUploader = require('./routes/cloudinaryUploader');
var dbCleaner = require('./routes/db.dev');
var app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');


app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public/')));

app.use(function(req, res, next) {
    // TODO : I suggest to change "localhost:8100" to a real domain set with a proxy in the ionic app
    var allowedOrigins = ["http://localhost:8100", "http://10.212.100.185:8100"];
    var origin = req.headers.origin;
    if(allowedOrigins.indexOf(origin) > -1){
        res.setHeader('Access-Control-Allow-Origin', origin);
    }
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    res.header("Access-Control-Allow-Credentials", true);
    res.header("Access-Control-Allow-Methods","PUT, GET, POST, DELETE, OPTIONS");
    next();
});
// required for passport
app.use(require('express-session')({
    secret: 'MEAN',
    resave: false,
    saveUninitialized: false
})); // session secret
app.use(passport.initialize());
app.use(passport.session()); // persistent login sessions
{'fraction_non_alphanumeric': 0.18765432098765433, 'fraction_numerical': 0.006913580246913581, 'mean_word_length': 5.409810126582278, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '990140', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1196, 'n_words': 259}