65d125c6252160b3dc0b4733c9e3edcd15d274d7
[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 _0xfaa3=['./environment','../mysqldb','default','env','production','join','root','public','development','test','appPath','client','use','set','json\x20replacer','toISOString','split','static','views','/server/views','engine','ejs','renderFile','view\x20engine','html','urlencoded','json','50mb','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment'];(function(_0x326e79,_0x33dc91){var _0x37eb89=function(_0xbaef25){while(--_0xbaef25){_0x326e79['push'](_0x326e79['shift']());}};_0x37eb89(++_0x33dc91);}(_0xfaa3,0x1a8));var _0x3faa=function(_0x3b2d00,_0x2748ed){_0x3b2d00=_0x3b2d00-0x0;var _0x3e333a=_0xfaa3[_0x3b2d00];return _0x3e333a;};'use strict';var express=require('express');var favicon=require(_0x3faa('0x0'));var bodyParser=require(_0x3faa('0x1'));var methodOverride=require('method-override');var cookieParser=require(_0x3faa('0x2'));var errorHandler=require(_0x3faa('0x3'));var path=require(_0x3faa('0x4'));var passport=require(_0x3faa('0x5'));var cors=require(_0x3faa('0x6'));var moment=require(_0x3faa('0x7'));var config=require(_0x3faa('0x8'));var db=require(_0x3faa('0x9'))['db'];exports[_0x3faa('0xa')]=function(_0x45c5c0){var _0x486d8b=_0x45c5c0['get'](_0x3faa('0xb'));if(_0x486d8b===_0x3faa('0xc')){_0x45c5c0['set']('appPath',path[_0x3faa('0xd')](config[_0x3faa('0xe')],_0x3faa('0xf')));}if(_0x486d8b===_0x3faa('0x10')||_0x486d8b===_0x3faa('0x11')){_0x45c5c0['set'](_0x3faa('0x12'),path[_0x3faa('0xd')](config[_0x3faa('0xe')],_0x3faa('0x13')));_0x45c5c0[_0x3faa('0x14')](errorHandler());}_0x45c5c0[_0x3faa('0x15')](_0x3faa('0x16'),function(_0x51ea9d,_0x5ee1cd){if(this[_0x51ea9d]instanceof Date){_0x5ee1cd=this[_0x51ea9d][_0x3faa('0x17')]()[_0x3faa('0x18')]('.')[0x0]+'Z';}return _0x5ee1cd;});_0x45c5c0[_0x3faa('0x14')](express[_0x3faa('0x19')](_0x45c5c0['get'](_0x3faa('0x12'))));_0x45c5c0['set'](_0x3faa('0x1a'),config['root']+_0x3faa('0x1b'));_0x45c5c0[_0x3faa('0x1c')]('html',require(_0x3faa('0x1d'))[_0x3faa('0x1e')]);_0x45c5c0[_0x3faa('0x15')](_0x3faa('0x1f'),_0x3faa('0x20'));_0x45c5c0[_0x3faa('0x14')](bodyParser[_0x3faa('0x21')]({'limit':'50mb','extended':!![]}));_0x45c5c0['use'](bodyParser[_0x3faa('0x22')]({'limit':_0x3faa('0x23')}));_0x45c5c0[_0x3faa('0x14')](cors());_0x45c5c0[_0x3faa('0x14')](methodOverride());_0x45c5c0['use'](cookieParser());_0x45c5c0['use'](passport['initialize']());};