Built motion from commit (unavailable).|2.4.4
[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 _0x9c44=['appPath','development','favicon.ico','set','client','json\x20replacer','split','static','views','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','body-parser','method-override','cookie-parser','errorhandler','path','passport','./environment','default','get','env','use','join','root','public'];(function(_0x67f30a,_0x2e62de){var _0x59b41e=function(_0x1716a5){while(--_0x1716a5){_0x67f30a['push'](_0x67f30a['shift']());}};_0x59b41e(++_0x2e62de);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x49c4('0x0'));var methodOverride=require(_0x49c4('0x1'));var cookieParser=require(_0x49c4('0x2'));var errorHandler=require(_0x49c4('0x3'));var path=require(_0x49c4('0x4'));var passport=require(_0x49c4('0x5'));var cors=require('cors');var moment=require('moment');var config=require(_0x49c4('0x6'));var db=require('../mysqldb')['db'];exports[_0x49c4('0x7')]=function(_0x6030ae){var _0x69bc41=_0x6030ae[_0x49c4('0x8')](_0x49c4('0x9'));if(_0x69bc41==='production'){_0x6030ae[_0x49c4('0xa')](favicon(path[_0x49c4('0xb')](config[_0x49c4('0xc')],_0x49c4('0xd'),'favicon.ico')));_0x6030ae['set'](_0x49c4('0xe'),path[_0x49c4('0xb')](config['root'],_0x49c4('0xd')));}if(_0x69bc41===_0x49c4('0xf')||_0x69bc41==='test'){_0x6030ae['use'](favicon(path[_0x49c4('0xb')](config[_0x49c4('0xc')],'client',_0x49c4('0x10'))));_0x6030ae[_0x49c4('0x11')]('appPath',path[_0x49c4('0xb')](config[_0x49c4('0xc')],_0x49c4('0x12')));_0x6030ae[_0x49c4('0xa')](errorHandler());}_0x6030ae[_0x49c4('0x11')](_0x49c4('0x13'),function(_0x75ea8,_0x3de397){if(this[_0x75ea8]instanceof Date){_0x3de397=this[_0x75ea8]['toISOString']()[_0x49c4('0x14')]('.')[0x0]+'Z';}return _0x3de397;});_0x6030ae[_0x49c4('0xa')](express[_0x49c4('0x15')](_0x6030ae[_0x49c4('0x8')](_0x49c4('0xe'))));_0x6030ae['set'](_0x49c4('0x16'),config[_0x49c4('0xc')]+'/server/views');_0x6030ae['engine'](_0x49c4('0x17'),require(_0x49c4('0x18'))[_0x49c4('0x19')]);_0x6030ae['set'](_0x49c4('0x1a'),'html');_0x6030ae[_0x49c4('0xa')](bodyParser[_0x49c4('0x1b')]({'limit':_0x49c4('0x1c'),'extended':!![]}));_0x6030ae[_0x49c4('0xa')](bodyParser[_0x49c4('0x1d')]({'limit':_0x49c4('0x1c')}));_0x6030ae[_0x49c4('0xa')](cors());_0x6030ae[_0x49c4('0xa')](methodOverride());_0x6030ae[_0x49c4('0xa')](cookieParser());_0x6030ae['use'](passport['initialize']());};