Built motion from commit (unavailable).|2.5.14
[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 _0xac65=['initialize','express','body-parser','method-override','cookie-parser','path','passport','moment','./environment','../mysqldb','default','get','production','set','appPath','root','public','development','test','join','use','json\x20replacer','toISOString','static','views','/server/views','html','renderFile','view\x20engine','50mb','json'];(function(_0x16ea64,_0x427bc6){var _0x3ec313=function(_0x21df63){while(--_0x21df63){_0x16ea64['push'](_0x16ea64['shift']());}};_0x3ec313(++_0x427bc6);}(_0xac65,0x156));var _0x5ac6=function(_0x2f9802,_0x6a0d){_0x2f9802=_0x2f9802-0x0;var _0x368dff=_0xac65[_0x2f9802];return _0x368dff;};'use strict';var express=require(_0x5ac6('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x5ac6('0x1'));var methodOverride=require(_0x5ac6('0x2'));var cookieParser=require(_0x5ac6('0x3'));var errorHandler=require('errorhandler');var path=require(_0x5ac6('0x4'));var passport=require(_0x5ac6('0x5'));var cors=require('cors');var moment=require(_0x5ac6('0x6'));var config=require(_0x5ac6('0x7'));var db=require(_0x5ac6('0x8'))['db'];exports[_0x5ac6('0x9')]=function(_0x28980d){var _0xecf30=_0x28980d[_0x5ac6('0xa')]('env');if(_0xecf30===_0x5ac6('0xb')){_0x28980d[_0x5ac6('0xc')](_0x5ac6('0xd'),path['join'](config[_0x5ac6('0xe')],_0x5ac6('0xf')));}if(_0xecf30===_0x5ac6('0x10')||_0xecf30===_0x5ac6('0x11')){_0x28980d[_0x5ac6('0xc')](_0x5ac6('0xd'),path[_0x5ac6('0x12')](config[_0x5ac6('0xe')],'client'));_0x28980d[_0x5ac6('0x13')](errorHandler());}_0x28980d[_0x5ac6('0xc')](_0x5ac6('0x14'),function(_0x1a4470,_0x1f2bf4){if(this[_0x1a4470]instanceof Date){_0x1f2bf4=this[_0x1a4470][_0x5ac6('0x15')]()['split']('.')[0x0]+'Z';}return _0x1f2bf4;});_0x28980d['use'](express[_0x5ac6('0x16')](_0x28980d[_0x5ac6('0xa')](_0x5ac6('0xd'))));_0x28980d['set'](_0x5ac6('0x17'),config[_0x5ac6('0xe')]+_0x5ac6('0x18'));_0x28980d['engine'](_0x5ac6('0x19'),require('ejs')[_0x5ac6('0x1a')]);_0x28980d[_0x5ac6('0xc')](_0x5ac6('0x1b'),_0x5ac6('0x19'));_0x28980d[_0x5ac6('0x13')](bodyParser['urlencoded']({'limit':_0x5ac6('0x1c'),'extended':!![]}));_0x28980d[_0x5ac6('0x13')](bodyParser[_0x5ac6('0x1d')]({'limit':'50mb'}));_0x28980d[_0x5ac6('0x13')](cors());_0x28980d[_0x5ac6('0x13')](methodOverride());_0x28980d[_0x5ac6('0x13')](cookieParser());_0x28980d[_0x5ac6('0x13')](passport[_0x5ac6('0x1e')]());};