27154aef8287e0ca8f329db6e470fa82597f753f
[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 _0x68df=['method-override','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','env','production','set','appPath','join','public','test','root','client','use','json\x20replacer','toISOString','split','static','get','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','initialize','serve-favicon','body-parser'];(function(_0x5cf94d,_0x3e9b52){var _0x3242a6=function(_0x22e8b8){while(--_0x22e8b8){_0x5cf94d['push'](_0x5cf94d['shift']());}};_0x3242a6(++_0x3e9b52);}(_0x68df,0x1d2));var _0xf68d=function(_0x52684f,_0xff73fc){_0x52684f=_0x52684f-0x0;var _0x4a55f0=_0x68df[_0x52684f];return _0x4a55f0;};'use strict';var express=require('express');var favicon=require(_0xf68d('0x0'));var bodyParser=require(_0xf68d('0x1'));var methodOverride=require(_0xf68d('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xf68d('0x3'));var path=require(_0xf68d('0x4'));var passport=require(_0xf68d('0x5'));var cors=require(_0xf68d('0x6'));var moment=require(_0xf68d('0x7'));var config=require(_0xf68d('0x8'));var db=require(_0xf68d('0x9'))['db'];exports[_0xf68d('0xa')]=function(_0x22d1ac){var _0x160198=_0x22d1ac['get'](_0xf68d('0xb'));if(_0x160198===_0xf68d('0xc')){_0x22d1ac[_0xf68d('0xd')](_0xf68d('0xe'),path[_0xf68d('0xf')](config['root'],_0xf68d('0x10')));}if(_0x160198==='development'||_0x160198===_0xf68d('0x11')){_0x22d1ac['set'](_0xf68d('0xe'),path[_0xf68d('0xf')](config[_0xf68d('0x12')],_0xf68d('0x13')));_0x22d1ac[_0xf68d('0x14')](errorHandler());}_0x22d1ac['set'](_0xf68d('0x15'),function(_0x14ac9c,_0x3dddc7){if(this[_0x14ac9c]instanceof Date){_0x3dddc7=this[_0x14ac9c][_0xf68d('0x16')]()[_0xf68d('0x17')]('.')[0x0]+'Z';}return _0x3dddc7;});_0x22d1ac[_0xf68d('0x14')](express[_0xf68d('0x18')](_0x22d1ac[_0xf68d('0x19')](_0xf68d('0xe'))));_0x22d1ac[_0xf68d('0xd')](_0xf68d('0x1a'),config[_0xf68d('0x12')]+_0xf68d('0x1b'));_0x22d1ac[_0xf68d('0x1c')](_0xf68d('0x1d'),require(_0xf68d('0x1e'))[_0xf68d('0x1f')]);_0x22d1ac[_0xf68d('0xd')](_0xf68d('0x20'),'html');_0x22d1ac['use'](bodyParser[_0xf68d('0x21')]({'limit':'50mb','extended':!![]}));_0x22d1ac[_0xf68d('0x14')](bodyParser['json']({'limit':_0xf68d('0x22')}));_0x22d1ac['use'](cors());_0x22d1ac['use'](methodOverride());_0x22d1ac[_0xf68d('0x14')](cookieParser());_0x22d1ac[_0xf68d('0x14')](passport[_0xf68d('0x23')]());};