9a304700334fed3f3fd92eeb6b917ce30164db2f
[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 _0x64c5=['urlencoded','json','50mb','initialize','express','method-override','errorhandler','path','passport','cors','moment','./environment','default','get','env','production','set','join','root','public','development','appPath','client','use','json\x20replacer','toISOString','split','static','views','/server/views','engine','html','ejs','renderFile','view\x20engine'];(function(_0x84fc81,_0x262463){var _0x478bf3=function(_0x46337c){while(--_0x46337c){_0x84fc81['push'](_0x84fc81['shift']());}};_0x478bf3(++_0x262463);}(_0x64c5,0x6d));var _0x564c=function(_0xfa7210,_0x3ae2f2){_0xfa7210=_0xfa7210-0x0;var _0xbfd2a=_0x64c5[_0xfa7210];return _0xbfd2a;};'use strict';var express=require(_0x564c('0x0'));var favicon=require('serve-favicon');var bodyParser=require('body-parser');var methodOverride=require(_0x564c('0x1'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x564c('0x2'));var path=require(_0x564c('0x3'));var passport=require(_0x564c('0x4'));var cors=require(_0x564c('0x5'));var moment=require(_0x564c('0x6'));var config=require(_0x564c('0x7'));var db=require('../mysqldb')['db'];exports[_0x564c('0x8')]=function(_0x36eca7){var _0x2ed774=_0x36eca7[_0x564c('0x9')](_0x564c('0xa'));if(_0x2ed774===_0x564c('0xb')){_0x36eca7[_0x564c('0xc')]('appPath',path[_0x564c('0xd')](config[_0x564c('0xe')],_0x564c('0xf')));}if(_0x2ed774===_0x564c('0x10')||_0x2ed774==='test'){_0x36eca7[_0x564c('0xc')](_0x564c('0x11'),path[_0x564c('0xd')](config[_0x564c('0xe')],_0x564c('0x12')));_0x36eca7[_0x564c('0x13')](errorHandler());}_0x36eca7['set'](_0x564c('0x14'),function(_0x217781,_0xd21b47){if(this[_0x217781]instanceof Date){_0xd21b47=this[_0x217781][_0x564c('0x15')]()[_0x564c('0x16')]('.')[0x0]+'Z';}return _0xd21b47;});_0x36eca7[_0x564c('0x13')](express[_0x564c('0x17')](_0x36eca7['get']('appPath')));_0x36eca7[_0x564c('0xc')](_0x564c('0x18'),config[_0x564c('0xe')]+_0x564c('0x19'));_0x36eca7[_0x564c('0x1a')](_0x564c('0x1b'),require(_0x564c('0x1c'))[_0x564c('0x1d')]);_0x36eca7['set'](_0x564c('0x1e'),'html');_0x36eca7[_0x564c('0x13')](bodyParser[_0x564c('0x1f')]({'limit':'50mb','extended':!![]}));_0x36eca7['use'](bodyParser[_0x564c('0x20')]({'limit':_0x564c('0x21')}));_0x36eca7[_0x564c('0x13')](cors());_0x36eca7[_0x564c('0x13')](methodOverride());_0x36eca7[_0x564c('0x13')](cookieParser());_0x36eca7[_0x564c('0x13')](passport[_0x564c('0x22')]());};