52ea6684a41bc1e653dd9efbba40c21a52f302c1
[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 _0xf6c2=['toISOString','static','views','engine','view\x20engine','html','urlencoded','50mb','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','./environment','default','get','production','set','appPath','join','root','public','development','test','client','use'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xf6c2,0x189));var _0x2f6c=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xf6c2[_0x4b2436];return _0x4f5ab2;};'use strict';var express=require(_0x2f6c('0x0'));var favicon=require(_0x2f6c('0x1'));var bodyParser=require(_0x2f6c('0x2'));var methodOverride=require(_0x2f6c('0x3'));var cookieParser=require(_0x2f6c('0x4'));var errorHandler=require(_0x2f6c('0x5'));var path=require(_0x2f6c('0x6'));var passport=require(_0x2f6c('0x7'));var cors=require(_0x2f6c('0x8'));var moment=require(_0x2f6c('0x9'));var config=require(_0x2f6c('0xa'));var db=require('../mysqldb')['db'];exports[_0x2f6c('0xb')]=function(_0x3a2b6c){var _0x528810=_0x3a2b6c[_0x2f6c('0xc')]('env');if(_0x528810===_0x2f6c('0xd')){_0x3a2b6c[_0x2f6c('0xe')](_0x2f6c('0xf'),path[_0x2f6c('0x10')](config[_0x2f6c('0x11')],_0x2f6c('0x12')));}if(_0x528810===_0x2f6c('0x13')||_0x528810===_0x2f6c('0x14')){_0x3a2b6c['set'](_0x2f6c('0xf'),path['join'](config[_0x2f6c('0x11')],_0x2f6c('0x15')));_0x3a2b6c[_0x2f6c('0x16')](errorHandler());}_0x3a2b6c[_0x2f6c('0xe')]('json\x20replacer',function(_0x2046e3,_0x14c68b){if(this[_0x2046e3]instanceof Date){_0x14c68b=this[_0x2046e3][_0x2f6c('0x17')]()['split']('.')[0x0]+'Z';}return _0x14c68b;});_0x3a2b6c['use'](express[_0x2f6c('0x18')](_0x3a2b6c[_0x2f6c('0xc')](_0x2f6c('0xf'))));_0x3a2b6c[_0x2f6c('0xe')](_0x2f6c('0x19'),config[_0x2f6c('0x11')]+'/server/views');_0x3a2b6c[_0x2f6c('0x1a')]('html',require('ejs')['renderFile']);_0x3a2b6c['set'](_0x2f6c('0x1b'),_0x2f6c('0x1c'));_0x3a2b6c[_0x2f6c('0x16')](bodyParser[_0x2f6c('0x1d')]({'limit':_0x2f6c('0x1e'),'extended':!![]}));_0x3a2b6c['use'](bodyParser['json']({'limit':_0x2f6c('0x1e')}));_0x3a2b6c[_0x2f6c('0x16')](cors());_0x3a2b6c[_0x2f6c('0x16')](methodOverride());_0x3a2b6c[_0x2f6c('0x16')](cookieParser());_0x3a2b6c['use'](passport[_0x2f6c('0x1f')]());};