Built motion from commit (unavailable).|2.5.21
[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 _0xc4f5=['static','appPath','views','/server/views','engine','ejs','renderFile','view\x20engine','html','urlencoded','json','50mb','initialize','express','body-parser','cookie-parser','path','passport','cors','moment','./environment','../mysqldb','get','env','production','set','join','root','public','development','client','json\x20replacer','toISOString','split','use'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4f5,0x18e));var _0x5c4f=function(_0x3bbd1f,_0x119571){_0x3bbd1f=_0x3bbd1f-0x0;var _0x4cb1fe=_0xc4f5[_0x3bbd1f];return _0x4cb1fe;};'use strict';var express=require(_0x5c4f('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x5c4f('0x1'));var methodOverride=require('method-override');var cookieParser=require(_0x5c4f('0x2'));var errorHandler=require('errorhandler');var path=require(_0x5c4f('0x3'));var passport=require(_0x5c4f('0x4'));var cors=require(_0x5c4f('0x5'));var moment=require(_0x5c4f('0x6'));var config=require(_0x5c4f('0x7'));var db=require(_0x5c4f('0x8'))['db'];exports['default']=function(_0xbac409){var _0x5f057c=_0xbac409[_0x5c4f('0x9')](_0x5c4f('0xa'));if(_0x5f057c===_0x5c4f('0xb')){_0xbac409[_0x5c4f('0xc')]('appPath',path[_0x5c4f('0xd')](config[_0x5c4f('0xe')],_0x5c4f('0xf')));}if(_0x5f057c===_0x5c4f('0x10')||_0x5f057c==='test'){_0xbac409[_0x5c4f('0xc')]('appPath',path[_0x5c4f('0xd')](config['root'],_0x5c4f('0x11')));_0xbac409['use'](errorHandler());}_0xbac409[_0x5c4f('0xc')](_0x5c4f('0x12'),function(_0x536d19,_0x47e499){if(this[_0x536d19]instanceof Date){_0x47e499=this[_0x536d19][_0x5c4f('0x13')]()[_0x5c4f('0x14')]('.')[0x0]+'Z';}return _0x47e499;});_0xbac409[_0x5c4f('0x15')](express[_0x5c4f('0x16')](_0xbac409['get'](_0x5c4f('0x17'))));_0xbac409[_0x5c4f('0xc')](_0x5c4f('0x18'),config[_0x5c4f('0xe')]+_0x5c4f('0x19'));_0xbac409[_0x5c4f('0x1a')]('html',require(_0x5c4f('0x1b'))[_0x5c4f('0x1c')]);_0xbac409['set'](_0x5c4f('0x1d'),_0x5c4f('0x1e'));_0xbac409['use'](bodyParser[_0x5c4f('0x1f')]({'limit':'50mb','extended':!![]}));_0xbac409[_0x5c4f('0x15')](bodyParser[_0x5c4f('0x20')]({'limit':_0x5c4f('0x21')}));_0xbac409['use'](cors());_0xbac409[_0x5c4f('0x15')](methodOverride());_0xbac409['use'](cookieParser());_0xbac409[_0x5c4f('0x15')](passport[_0x5c4f('0x22')]());};