17a73cf53957981c53f448f198c435f8584d3475
[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 _0xc30a=['engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','express','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','../mysqldb','get','production','join','root','public','development','set','appPath','client','use','json\x20replacer','toISOString','split','static','views'];(function(_0x45807f,_0x101146){var _0x3d3126=function(_0x5b692e){while(--_0x5b692e){_0x45807f['push'](_0x45807f['shift']());}};_0x3d3126(++_0x101146);}(_0xc30a,0x168));var _0xac30=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xc30a[_0x4e9628];return _0x27bc8c;};'use strict';var express=require(_0xac30('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0xac30('0x1'));var methodOverride=require(_0xac30('0x2'));var cookieParser=require(_0xac30('0x3'));var errorHandler=require(_0xac30('0x4'));var path=require(_0xac30('0x5'));var passport=require(_0xac30('0x6'));var cors=require(_0xac30('0x7'));var moment=require('moment');var config=require('./environment');var db=require(_0xac30('0x8'))['db'];exports['default']=function(_0xf378f0){var _0x301367=_0xf378f0[_0xac30('0x9')]('env');if(_0x301367===_0xac30('0xa')){_0xf378f0['set']('appPath',path[_0xac30('0xb')](config[_0xac30('0xc')],_0xac30('0xd')));}if(_0x301367===_0xac30('0xe')||_0x301367==='test'){_0xf378f0[_0xac30('0xf')](_0xac30('0x10'),path[_0xac30('0xb')](config[_0xac30('0xc')],_0xac30('0x11')));_0xf378f0[_0xac30('0x12')](errorHandler());}_0xf378f0[_0xac30('0xf')](_0xac30('0x13'),function(_0x18e395,_0x17f31e){if(this[_0x18e395]instanceof Date){_0x17f31e=this[_0x18e395][_0xac30('0x14')]()[_0xac30('0x15')]('.')[0x0]+'Z';}return _0x17f31e;});_0xf378f0[_0xac30('0x12')](express[_0xac30('0x16')](_0xf378f0[_0xac30('0x9')](_0xac30('0x10'))));_0xf378f0[_0xac30('0xf')](_0xac30('0x17'),config[_0xac30('0xc')]+'/server/views');_0xf378f0[_0xac30('0x18')](_0xac30('0x19'),require(_0xac30('0x1a'))[_0xac30('0x1b')]);_0xf378f0[_0xac30('0xf')](_0xac30('0x1c'),_0xac30('0x19'));_0xf378f0[_0xac30('0x12')](bodyParser[_0xac30('0x1d')]({'limit':_0xac30('0x1e'),'extended':!![]}));_0xf378f0[_0xac30('0x12')](bodyParser[_0xac30('0x1f')]({'limit':_0xac30('0x1e')}));_0xf378f0['use'](cors());_0xf378f0[_0xac30('0x12')](methodOverride());_0xf378f0[_0xac30('0x12')](cookieParser());_0xf378f0[_0xac30('0x12')](passport['initialize']());};