18b433c80a0e6f160f9215ae211614309fede3f1
[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 _0xc9a9=['ejs','renderFile','view\x20engine','urlencoded','50mb','use','json','express','body-parser','method-override','cookie-parser','errorhandler','path','moment','./environment','../mysqldb','get','production','set','appPath','join','root','public','development','test','client','json\x20replacer','toISOString','split','static','views','/server/views','engine','html'];(function(_0x198d2e,_0x2a4e58){var _0x20f78e=function(_0x429eac){while(--_0x429eac){_0x198d2e['push'](_0x198d2e['shift']());}};_0x20f78e(++_0x2a4e58);}(_0xc9a9,0x117));var _0x9c9a=function(_0x52ffd7,_0x2169ef){_0x52ffd7=_0x52ffd7-0x0;var _0x2762ef=_0xc9a9[_0x52ffd7];return _0x2762ef;};'use strict';var express=require(_0x9c9a('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x9c9a('0x1'));var methodOverride=require(_0x9c9a('0x2'));var cookieParser=require(_0x9c9a('0x3'));var errorHandler=require(_0x9c9a('0x4'));var path=require(_0x9c9a('0x5'));var passport=require('passport');var cors=require('cors');var moment=require(_0x9c9a('0x6'));var config=require(_0x9c9a('0x7'));var db=require(_0x9c9a('0x8'))['db'];exports['default']=function(_0x3aef54){var _0x2284fc=_0x3aef54[_0x9c9a('0x9')]('env');if(_0x2284fc===_0x9c9a('0xa')){_0x3aef54[_0x9c9a('0xb')](_0x9c9a('0xc'),path[_0x9c9a('0xd')](config[_0x9c9a('0xe')],_0x9c9a('0xf')));}if(_0x2284fc===_0x9c9a('0x10')||_0x2284fc===_0x9c9a('0x11')){_0x3aef54[_0x9c9a('0xb')]('appPath',path[_0x9c9a('0xd')](config[_0x9c9a('0xe')],_0x9c9a('0x12')));_0x3aef54['use'](errorHandler());}_0x3aef54[_0x9c9a('0xb')](_0x9c9a('0x13'),function(_0x35954e,_0x53d835){if(this[_0x35954e]instanceof Date){_0x53d835=this[_0x35954e][_0x9c9a('0x14')]()[_0x9c9a('0x15')]('.')[0x0]+'Z';}return _0x53d835;});_0x3aef54['use'](express[_0x9c9a('0x16')](_0x3aef54['get'](_0x9c9a('0xc'))));_0x3aef54['set'](_0x9c9a('0x17'),config[_0x9c9a('0xe')]+_0x9c9a('0x18'));_0x3aef54[_0x9c9a('0x19')](_0x9c9a('0x1a'),require(_0x9c9a('0x1b'))[_0x9c9a('0x1c')]);_0x3aef54[_0x9c9a('0xb')](_0x9c9a('0x1d'),_0x9c9a('0x1a'));_0x3aef54['use'](bodyParser[_0x9c9a('0x1e')]({'limit':_0x9c9a('0x1f'),'extended':!![]}));_0x3aef54[_0x9c9a('0x20')](bodyParser[_0x9c9a('0x21')]({'limit':_0x9c9a('0x1f')}));_0x3aef54[_0x9c9a('0x20')](cors());_0x3aef54[_0x9c9a('0x20')](methodOverride());_0x3aef54['use'](cookieParser());_0x3aef54[_0x9c9a('0x20')](passport['initialize']());};