da16adf9cee7c373b566ff6210303b09e8748b28
[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 _0x4497=['html','ejs','renderFile','50mb','json','express','method-override','errorhandler','path','passport','cors','moment','get','env','production','set','appPath','root','public','development','test','join','client','use','json\x20replacer','toISOString','split','views','/server/views','engine'];(function(_0x17347f,_0x5571ea){var _0x76a59f=function(_0x52c4d9){while(--_0x52c4d9){_0x17347f['push'](_0x17347f['shift']());}};_0x76a59f(++_0x5571ea);}(_0x4497,0x7d));var _0x7449=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0x4497[_0x207d2f];return _0x3c3498;};'use strict';var express=require(_0x7449('0x0'));var favicon=require('serve-favicon');var bodyParser=require('body-parser');var methodOverride=require(_0x7449('0x1'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x7449('0x2'));var path=require(_0x7449('0x3'));var passport=require(_0x7449('0x4'));var cors=require(_0x7449('0x5'));var moment=require(_0x7449('0x6'));var config=require('./environment');var db=require('../mysqldb')['db'];exports['default']=function(_0x1d9ac8){var _0x1a27e6=_0x1d9ac8[_0x7449('0x7')](_0x7449('0x8'));if(_0x1a27e6===_0x7449('0x9')){_0x1d9ac8[_0x7449('0xa')](_0x7449('0xb'),path['join'](config[_0x7449('0xc')],_0x7449('0xd')));}if(_0x1a27e6===_0x7449('0xe')||_0x1a27e6===_0x7449('0xf')){_0x1d9ac8[_0x7449('0xa')]('appPath',path[_0x7449('0x10')](config[_0x7449('0xc')],_0x7449('0x11')));_0x1d9ac8[_0x7449('0x12')](errorHandler());}_0x1d9ac8[_0x7449('0xa')](_0x7449('0x13'),function(_0xb16782,_0x444d2f){if(this[_0xb16782]instanceof Date){_0x444d2f=this[_0xb16782][_0x7449('0x14')]()[_0x7449('0x15')]('.')[0x0]+'Z';}return _0x444d2f;});_0x1d9ac8[_0x7449('0x12')](express['static'](_0x1d9ac8[_0x7449('0x7')]('appPath')));_0x1d9ac8[_0x7449('0xa')](_0x7449('0x16'),config[_0x7449('0xc')]+_0x7449('0x17'));_0x1d9ac8[_0x7449('0x18')](_0x7449('0x19'),require(_0x7449('0x1a'))[_0x7449('0x1b')]);_0x1d9ac8['set']('view\x20engine','html');_0x1d9ac8[_0x7449('0x12')](bodyParser['urlencoded']({'limit':_0x7449('0x1c'),'extended':!![]}));_0x1d9ac8['use'](bodyParser[_0x7449('0x1d')]({'limit':_0x7449('0x1c')}));_0x1d9ac8[_0x7449('0x12')](cors());_0x1d9ac8['use'](methodOverride());_0x1d9ac8[_0x7449('0x12')](cookieParser());_0x1d9ac8[_0x7449('0x12')](passport['initialize']());};