e6853c4e5bb5c70982b615329c78cae99c113bac
[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 _0x8353=['urlencoded','50mb','json','initialize','express','body-parser','method-override','cookie-parser','errorhandler','path','passport','moment','./environment','../mysqldb','get','env','set','appPath','join','root','public','development','test','use','json\x20replacer','toISOString','split','/server/views','engine','html','ejs'];(function(_0xca2aab,_0x57da5a){var _0x114790=function(_0x48b7de){while(--_0x48b7de){_0xca2aab['push'](_0xca2aab['shift']());}};_0x114790(++_0x57da5a);}(_0x8353,0xbe));var _0x3835=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x8353[_0x465028];return _0xb783d4;};'use strict';var express=require(_0x3835('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x3835('0x1'));var methodOverride=require(_0x3835('0x2'));var cookieParser=require(_0x3835('0x3'));var errorHandler=require(_0x3835('0x4'));var path=require(_0x3835('0x5'));var passport=require(_0x3835('0x6'));var cors=require('cors');var moment=require(_0x3835('0x7'));var config=require(_0x3835('0x8'));var db=require(_0x3835('0x9'))['db'];exports['default']=function(_0x380684){var _0x26857d=_0x380684[_0x3835('0xa')](_0x3835('0xb'));if(_0x26857d==='production'){_0x380684[_0x3835('0xc')](_0x3835('0xd'),path[_0x3835('0xe')](config[_0x3835('0xf')],_0x3835('0x10')));}if(_0x26857d===_0x3835('0x11')||_0x26857d===_0x3835('0x12')){_0x380684['set'](_0x3835('0xd'),path['join'](config[_0x3835('0xf')],'client'));_0x380684[_0x3835('0x13')](errorHandler());}_0x380684['set'](_0x3835('0x14'),function(_0x44767b,_0x1e5e9c){if(this[_0x44767b]instanceof Date){_0x1e5e9c=this[_0x44767b][_0x3835('0x15')]()[_0x3835('0x16')]('.')[0x0]+'Z';}return _0x1e5e9c;});_0x380684[_0x3835('0x13')](express['static'](_0x380684[_0x3835('0xa')](_0x3835('0xd'))));_0x380684['set']('views',config[_0x3835('0xf')]+_0x3835('0x17'));_0x380684[_0x3835('0x18')](_0x3835('0x19'),require(_0x3835('0x1a'))['renderFile']);_0x380684['set']('view\x20engine',_0x3835('0x19'));_0x380684['use'](bodyParser[_0x3835('0x1b')]({'limit':_0x3835('0x1c'),'extended':!![]}));_0x380684[_0x3835('0x13')](bodyParser[_0x3835('0x1d')]({'limit':_0x3835('0x1c')}));_0x380684[_0x3835('0x13')](cors());_0x380684[_0x3835('0x13')](methodOverride());_0x380684[_0x3835('0x13')](cookieParser());_0x380684['use'](passport[_0x3835('0x1e')]());};