Built motion from commit 43538d75.|2.5.35
[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 _0x73d1=['json','initialize','express','serve-favicon','body-parser','errorhandler','path','moment','./environment','../mysqldb','get','env','production','set','join','root','public','development','appPath','use','toISOString','/server/views','engine','view\x20engine','urlencoded','50mb'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x73d1,0x13a));var _0x173d=function(_0x3b224c,_0x4eaedb){_0x3b224c=_0x3b224c-0x0;var _0x4b21f3=_0x73d1[_0x3b224c];return _0x4b21f3;};'use strict';var express=require(_0x173d('0x0'));var favicon=require(_0x173d('0x1'));var bodyParser=require(_0x173d('0x2'));var methodOverride=require('method-override');var cookieParser=require('cookie-parser');var errorHandler=require(_0x173d('0x3'));var path=require(_0x173d('0x4'));var passport=require('passport');var cors=require('cors');var moment=require(_0x173d('0x5'));var config=require(_0x173d('0x6'));var db=require(_0x173d('0x7'))['db'];exports['default']=function(_0x2ecdeb){var _0x4fd793=_0x2ecdeb[_0x173d('0x8')](_0x173d('0x9'));if(_0x4fd793===_0x173d('0xa')){_0x2ecdeb[_0x173d('0xb')]('appPath',path[_0x173d('0xc')](config[_0x173d('0xd')],_0x173d('0xe')));}if(_0x4fd793===_0x173d('0xf')||_0x4fd793==='test'){_0x2ecdeb[_0x173d('0xb')](_0x173d('0x10'),path[_0x173d('0xc')](config['root'],'client'));_0x2ecdeb[_0x173d('0x11')](errorHandler());}_0x2ecdeb[_0x173d('0xb')]('json\x20replacer',function(_0x5ea6e8,_0x4e9c22){if(this[_0x5ea6e8]instanceof Date){_0x4e9c22=this[_0x5ea6e8][_0x173d('0x12')]()['split']('.')[0x0]+'Z';}return _0x4e9c22;});_0x2ecdeb[_0x173d('0x11')](express['static'](_0x2ecdeb[_0x173d('0x8')](_0x173d('0x10'))));_0x2ecdeb[_0x173d('0xb')]('views',config[_0x173d('0xd')]+_0x173d('0x13'));_0x2ecdeb[_0x173d('0x14')]('html',require('ejs')['renderFile']);_0x2ecdeb[_0x173d('0xb')](_0x173d('0x15'),'html');_0x2ecdeb[_0x173d('0x11')](bodyParser[_0x173d('0x16')]({'limit':_0x173d('0x17'),'extended':!![]}));_0x2ecdeb['use'](bodyParser[_0x173d('0x18')]({'limit':_0x173d('0x17')}));_0x2ecdeb[_0x173d('0x11')](cors());_0x2ecdeb[_0x173d('0x11')](methodOverride());_0x2ecdeb[_0x173d('0x11')](cookieParser());_0x2ecdeb[_0x173d('0x11')](passport[_0x173d('0x19')]());};