3bf070734f932001c4e27f18a96993d6fee05b9c
[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 _0x0301=['public','development','appPath','use','set','toISOString','split','get','views','renderFile','view\x20engine','html','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','path','moment','./environment','../mysqldb','default','production','join'];(function(_0x4b08b3,_0x1041dc){var _0x3854a7=function(_0x52b3c4){while(--_0x52b3c4){_0x4b08b3['push'](_0x4b08b3['shift']());}};_0x3854a7(++_0x1041dc);}(_0x0301,0x1db));var _0x1030=function(_0x3388d8,_0x256024){_0x3388d8=_0x3388d8-0x0;var _0x2bbe73=_0x0301[_0x3388d8];return _0x2bbe73;};'use strict';var express=require(_0x1030('0x0'));var favicon=require(_0x1030('0x1'));var bodyParser=require(_0x1030('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x1030('0x3'));var errorHandler=require('errorhandler');var path=require(_0x1030('0x4'));var passport=require('passport');var cors=require('cors');var moment=require(_0x1030('0x5'));var config=require(_0x1030('0x6'));var db=require(_0x1030('0x7'))['db'];exports[_0x1030('0x8')]=function(_0xb46350){var _0x464523=_0xb46350['get']('env');if(_0x464523===_0x1030('0x9')){_0xb46350['set']('appPath',path[_0x1030('0xa')](config['root'],_0x1030('0xb')));}if(_0x464523===_0x1030('0xc')||_0x464523==='test'){_0xb46350['set'](_0x1030('0xd'),path[_0x1030('0xa')](config['root'],'client'));_0xb46350[_0x1030('0xe')](errorHandler());}_0xb46350[_0x1030('0xf')]('json\x20replacer',function(_0x24680f,_0x3d85df){if(this[_0x24680f]instanceof Date){_0x3d85df=this[_0x24680f][_0x1030('0x10')]()[_0x1030('0x11')]('.')[0x0]+'Z';}return _0x3d85df;});_0xb46350[_0x1030('0xe')](express['static'](_0xb46350[_0x1030('0x12')](_0x1030('0xd'))));_0xb46350[_0x1030('0xf')](_0x1030('0x13'),config['root']+'/server/views');_0xb46350['engine']('html',require('ejs')[_0x1030('0x14')]);_0xb46350[_0x1030('0xf')](_0x1030('0x15'),_0x1030('0x16'));_0xb46350[_0x1030('0xe')](bodyParser[_0x1030('0x17')]({'limit':_0x1030('0x18'),'extended':!![]}));_0xb46350['use'](bodyParser[_0x1030('0x19')]({'limit':_0x1030('0x18')}));_0xb46350[_0x1030('0xe')](cors());_0xb46350[_0x1030('0xe')](methodOverride());_0xb46350[_0x1030('0xe')](cookieParser());_0xb46350[_0x1030('0xe')](passport[_0x1030('0x1a')]());};