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