<commit_before>/**
 * =================
 * MAIN - Start
 * =================
 * App launcher
 */

var	express = require("express"),
	mongoose = require('mongoose'),
	http = require('http'),
	fs = require("fs"),
	engine = require('ejs-locals'),
	connect = require('connect'),
	config = require("./config"),
	logger = require("./logger");

// Catch for all exception
process.on('uncaughtException', function (error) {
   logger.error(error.stack);
});

var securityActivated = config.getProperty("security.auth");
logger.warn("Security activated : " + securityActivated);

var sslActivated = config.getProperty("security.ssl");
logger.warn("SSL activated : " + sslActivated);


/* ------------------------
 * DB connection
 * ------------------------
 */
mongoose.connect(config.getProperty("db.uri"), function(err) {
  if (err) { logger.error(err); }
});

var	modelUser = require("./model/user")(mongoose).model,
	modelModel = require("./model/model")(mongoose).model,
	modelRight = require("./model/right")(mongoose).model;

var	services = require("./services")(mongoose, modelUser, modelModel, modelRight),
	views = require("./views");

/* ------------------------
 * REST Server config
 * ------------------------
 */
var rest;
if(sslActivated) {
	rest = express({
		key: fs.readFileSync('security/server.key'),
		cert: fs.readFileSync('security/server.crt')<commit_msg><Server> Small fixes + normalization of REST API<commit_after>/**
 * =================
 * MAIN - Start
 * =================
 * App launcher
 */

var	express = require("express"),
	mongoose = require('mongoose'),
	http = require('http'),
	fs = require("fs"),
	engine = require('ejs-locals'),
	connect = require('connect'),
	config = require("./config"),
	logger = require("./logger");

// Catch for all exception
process.on('uncaughtException', function (error) {
   logger.error(error.stack);
});

var securityActivated = config.getProperty("security.auth");
logger.warn("Security activated : " + securityActivated);

var sslActivated = config.getProperty("security.ssl");
logger.warn("SSL activated : " + sslActivated);


/* ------------------------
 * DB connection
 * ------------------------
 */
mongoose.connect(config.getProperty("db.uri"), function(err) {
  if (err) { logger.error(err); }
});

var	modelUser = require("./model/user")(mongoose).model,
	modelModel = require("./model/model")(mongoose).model;

var	services = require("./services")(mongoose, modelUser, modelModel),
	views = require("./views");

/* ------------------------
 * REST Server config
 * ------------------------
 */
var rest;
if(sslActivated) {
	rest = express({
		key: fs.readFileSync('security/server.key'),
		cert: fs.readFileSync('security/server.crt')
{'fraction_non_alphanumeric': 0.2633714496495758, 'fraction_numerical': 0.0, 'mean_word_length': 3.381260096930533, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '6656111', 'n_tokens_mistral': 799, 'n_tokens_neox': 806, 'n_words': 154}