e3ee8dc8f5ac73a511cb5071b85a60161d9ead87
[motion2.git] / server / config / express.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xa33a=['path','cors','moment','./environment','../mysqldb','default','get','env','appPath','join','root','test','set','client','use','json\x20replacer','split','static','views','engine','ejs','view\x20engine','html','urlencoded','50mb','json','initialize','serve-favicon','method-override','cookie-parser'];(function(_0x3ea746,_0x45ec8b){var _0x39d3b3=function(_0x2bb8de){while(--_0x2bb8de){_0x3ea746['push'](_0x3ea746['shift']());}};_0x39d3b3(++_0x45ec8b);}(_0xa33a,0x75));var _0xaa33=function(_0xd0f9f4,_0xe74790){_0xd0f9f4=_0xd0f9f4-0x0;var _0x444782=_0xa33a[_0xd0f9f4];return _0x444782;};'use strict';var express=require('express');var favicon=require(_0xaa33('0x0'));var bodyParser=require('body-parser');var methodOverride=require(_0xaa33('0x1'));var cookieParser=require(_0xaa33('0x2'));var errorHandler=require('errorhandler');var path=require(_0xaa33('0x3'));var passport=require('passport');var cors=require(_0xaa33('0x4'));var moment=require(_0xaa33('0x5'));var config=require(_0xaa33('0x6'));var db=require(_0xaa33('0x7'))['db'];exports[_0xaa33('0x8')]=function(_0x2c95c5){var _0x67b5de=_0x2c95c5[_0xaa33('0x9')](_0xaa33('0xa'));if(_0x67b5de==='production'){_0x2c95c5['set'](_0xaa33('0xb'),path[_0xaa33('0xc')](config[_0xaa33('0xd')],'public'));}if(_0x67b5de==='development'||_0x67b5de===_0xaa33('0xe')){_0x2c95c5[_0xaa33('0xf')](_0xaa33('0xb'),path['join'](config[_0xaa33('0xd')],_0xaa33('0x10')));_0x2c95c5[_0xaa33('0x11')](errorHandler());}_0x2c95c5[_0xaa33('0xf')](_0xaa33('0x12'),function(_0x1e7caa,_0x28523c){if(this[_0x1e7caa]instanceof Date){_0x28523c=this[_0x1e7caa]['toISOString']()[_0xaa33('0x13')]('.')[0x0]+'Z';}return _0x28523c;});_0x2c95c5[_0xaa33('0x11')](express[_0xaa33('0x14')](_0x2c95c5[_0xaa33('0x9')](_0xaa33('0xb'))));_0x2c95c5[_0xaa33('0xf')](_0xaa33('0x15'),config[_0xaa33('0xd')]+'/server/views');_0x2c95c5[_0xaa33('0x16')]('html',require(_0xaa33('0x17'))['renderFile']);_0x2c95c5[_0xaa33('0xf')](_0xaa33('0x18'),_0xaa33('0x19'));_0x2c95c5[_0xaa33('0x11')](bodyParser[_0xaa33('0x1a')]({'limit':_0xaa33('0x1b'),'extended':!![]}));_0x2c95c5[_0xaa33('0x11')](bodyParser[_0xaa33('0x1c')]({'limit':_0xaa33('0x1b')}));_0x2c95c5[_0xaa33('0x11')](cors());_0x2c95c5[_0xaa33('0x11')](methodOverride());_0x2c95c5[_0xaa33('0x11')](cookieParser());_0x2c95c5[_0xaa33('0x11')](passport[_0xaa33('0x1d')]());};