Built motion from commit 497d3d92.|2.5.43
[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 _0x69bf=['/server/views','engine','ejs','renderFile','html','urlencoded','json','50mb','initialize','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','passport','moment','../mysqldb','get','production','set','join','root','public','development','appPath','client','use','toISOString','static','views'];(function(_0x3afcd3,_0x453f4f){var _0x2f83af=function(_0x3bd428){while(--_0x3bd428){_0x3afcd3['push'](_0x3afcd3['shift']());}};_0x2f83af(++_0x453f4f);}(_0x69bf,0x171));var _0xf69b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x69bf[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var favicon=require(_0xf69b('0x0'));var bodyParser=require(_0xf69b('0x1'));var methodOverride=require(_0xf69b('0x2'));var cookieParser=require(_0xf69b('0x3'));var errorHandler=require(_0xf69b('0x4'));var path=require('path');var passport=require(_0xf69b('0x5'));var cors=require('cors');var moment=require(_0xf69b('0x6'));var config=require('./environment');var db=require(_0xf69b('0x7'))['db'];exports['default']=function(_0x4302e2){var _0x12ba17=_0x4302e2[_0xf69b('0x8')]('env');if(_0x12ba17===_0xf69b('0x9')){_0x4302e2[_0xf69b('0xa')]('appPath',path[_0xf69b('0xb')](config[_0xf69b('0xc')],_0xf69b('0xd')));}if(_0x12ba17===_0xf69b('0xe')||_0x12ba17==='test'){_0x4302e2[_0xf69b('0xa')](_0xf69b('0xf'),path['join'](config[_0xf69b('0xc')],_0xf69b('0x10')));_0x4302e2[_0xf69b('0x11')](errorHandler());}_0x4302e2[_0xf69b('0xa')]('json\x20replacer',function(_0x59af7b,_0x5ddfd5){if(this[_0x59af7b]instanceof Date){_0x5ddfd5=this[_0x59af7b][_0xf69b('0x12')]()['split']('.')[0x0]+'Z';}return _0x5ddfd5;});_0x4302e2[_0xf69b('0x11')](express[_0xf69b('0x13')](_0x4302e2[_0xf69b('0x8')](_0xf69b('0xf'))));_0x4302e2['set'](_0xf69b('0x14'),config['root']+_0xf69b('0x15'));_0x4302e2[_0xf69b('0x16')]('html',require(_0xf69b('0x17'))[_0xf69b('0x18')]);_0x4302e2[_0xf69b('0xa')]('view\x20engine',_0xf69b('0x19'));_0x4302e2[_0xf69b('0x11')](bodyParser[_0xf69b('0x1a')]({'limit':'50mb','extended':!![]}));_0x4302e2[_0xf69b('0x11')](bodyParser[_0xf69b('0x1b')]({'limit':_0xf69b('0x1c')}));_0x4302e2['use'](cors());_0x4302e2[_0xf69b('0x11')](methodOverride());_0x4302e2[_0xf69b('0x11')](cookieParser());_0x4302e2[_0xf69b('0x11')](passport[_0xf69b('0x1d')]());};