1552cd93c4a988c140c45ed15d07d31d5d590452
[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 _0x9197=['ejs','renderFile','view\x20engine','html','urlencoded','50mb','initialize','express','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','set','appPath','join','root','public','development','client','use','json\x20replacer','toISOString','split','static','views','/server/views'];(function(_0x1b86c4,_0x396fb6){var _0x237e8c=function(_0x38cce1){while(--_0x38cce1){_0x1b86c4['push'](_0x1b86c4['shift']());}};_0x237e8c(++_0x396fb6);}(_0x9197,0x1ce));var _0x7919=function(_0x18fdff,_0x4a5bc8){_0x18fdff=_0x18fdff-0x0;var _0x50015a=_0x9197[_0x18fdff];return _0x50015a;};'use strict';var express=require(_0x7919('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x7919('0x1'));var methodOverride=require(_0x7919('0x2'));var cookieParser=require(_0x7919('0x3'));var errorHandler=require(_0x7919('0x4'));var path=require(_0x7919('0x5'));var passport=require(_0x7919('0x6'));var cors=require(_0x7919('0x7'));var moment=require(_0x7919('0x8'));var config=require(_0x7919('0x9'));var db=require(_0x7919('0xa'))['db'];exports[_0x7919('0xb')]=function(_0x29f14b){var _0x3f0313=_0x29f14b[_0x7919('0xc')](_0x7919('0xd'));if(_0x3f0313==='production'){_0x29f14b[_0x7919('0xe')](_0x7919('0xf'),path[_0x7919('0x10')](config[_0x7919('0x11')],_0x7919('0x12')));}if(_0x3f0313===_0x7919('0x13')||_0x3f0313==='test'){_0x29f14b[_0x7919('0xe')](_0x7919('0xf'),path[_0x7919('0x10')](config['root'],_0x7919('0x14')));_0x29f14b[_0x7919('0x15')](errorHandler());}_0x29f14b['set'](_0x7919('0x16'),function(_0x177724,_0x9f812e){if(this[_0x177724]instanceof Date){_0x9f812e=this[_0x177724][_0x7919('0x17')]()[_0x7919('0x18')]('.')[0x0]+'Z';}return _0x9f812e;});_0x29f14b['use'](express[_0x7919('0x19')](_0x29f14b[_0x7919('0xc')](_0x7919('0xf'))));_0x29f14b[_0x7919('0xe')](_0x7919('0x1a'),config[_0x7919('0x11')]+_0x7919('0x1b'));_0x29f14b['engine']('html',require(_0x7919('0x1c'))[_0x7919('0x1d')]);_0x29f14b[_0x7919('0xe')](_0x7919('0x1e'),_0x7919('0x1f'));_0x29f14b['use'](bodyParser[_0x7919('0x20')]({'limit':_0x7919('0x21'),'extended':!![]}));_0x29f14b[_0x7919('0x15')](bodyParser['json']({'limit':_0x7919('0x21')}));_0x29f14b[_0x7919('0x15')](cors());_0x29f14b[_0x7919('0x15')](methodOverride());_0x29f14b['use'](cookieParser());_0x29f14b[_0x7919('0x15')](passport[_0x7919('0x22')]());};