Built motion from commit 19a84241.|2.5.34
[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 _0xbbbe=['root','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','serve-favicon','body-parser','method-override','cookie-parser','path','passport','cors','moment','./environment','../mysqldb','get','env','set','appPath','public','development','test','join','client','use','toISOString','split','static','views'];(function(_0x53b22e,_0x5e248f){var _0x14a0a4=function(_0x5dcfb9){while(--_0x5dcfb9){_0x53b22e['push'](_0x53b22e['shift']());}};_0x14a0a4(++_0x5e248f);}(_0xbbbe,0x1e6));var _0xebbb=function(_0x481107,_0x30da89){_0x481107=_0x481107-0x0;var _0x5e3922=_0xbbbe[_0x481107];return _0x5e3922;};'use strict';var express=require('express');var favicon=require(_0xebbb('0x0'));var bodyParser=require(_0xebbb('0x1'));var methodOverride=require(_0xebbb('0x2'));var cookieParser=require(_0xebbb('0x3'));var errorHandler=require('errorhandler');var path=require(_0xebbb('0x4'));var passport=require(_0xebbb('0x5'));var cors=require(_0xebbb('0x6'));var moment=require(_0xebbb('0x7'));var config=require(_0xebbb('0x8'));var db=require(_0xebbb('0x9'))['db'];exports['default']=function(_0x27ebc2){var _0x1787d9=_0x27ebc2[_0xebbb('0xa')](_0xebbb('0xb'));if(_0x1787d9==='production'){_0x27ebc2[_0xebbb('0xc')](_0xebbb('0xd'),path['join'](config['root'],_0xebbb('0xe')));}if(_0x1787d9===_0xebbb('0xf')||_0x1787d9===_0xebbb('0x10')){_0x27ebc2['set']('appPath',path[_0xebbb('0x11')](config['root'],_0xebbb('0x12')));_0x27ebc2[_0xebbb('0x13')](errorHandler());}_0x27ebc2[_0xebbb('0xc')]('json\x20replacer',function(_0x5dd784,_0x11a48a){if(this[_0x5dd784]instanceof Date){_0x11a48a=this[_0x5dd784][_0xebbb('0x14')]()[_0xebbb('0x15')]('.')[0x0]+'Z';}return _0x11a48a;});_0x27ebc2[_0xebbb('0x13')](express[_0xebbb('0x16')](_0x27ebc2[_0xebbb('0xa')]('appPath')));_0x27ebc2[_0xebbb('0xc')](_0xebbb('0x17'),config[_0xebbb('0x18')]+_0xebbb('0x19'));_0x27ebc2[_0xebbb('0x1a')](_0xebbb('0x1b'),require(_0xebbb('0x1c'))[_0xebbb('0x1d')]);_0x27ebc2[_0xebbb('0xc')](_0xebbb('0x1e'),_0xebbb('0x1b'));_0x27ebc2[_0xebbb('0x13')](bodyParser[_0xebbb('0x1f')]({'limit':_0xebbb('0x20'),'extended':!![]}));_0x27ebc2[_0xebbb('0x13')](bodyParser[_0xebbb('0x21')]({'limit':'50mb'}));_0x27ebc2[_0xebbb('0x13')](cors());_0x27ebc2['use'](methodOverride());_0x27ebc2[_0xebbb('0x13')](cookieParser());_0x27ebc2[_0xebbb('0x13')](passport['initialize']());};