0224565a27f1abd79c27eb93f1cea998eef04eb5
[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 _0x0784=['appPath','test','root','client','toISOString','split','use','static','/server/views','engine','html','ejs','renderFile','urlencoded','50mb','initialize','express','serve-favicon','body-parser','cookie-parser','path','passport','cors','moment','./environment','../mysqldb','default','get','env','set'];(function(_0x2d2a99,_0x391bfd){var _0x3552a3=function(_0x22900e){while(--_0x22900e){_0x2d2a99['push'](_0x2d2a99['shift']());}};_0x3552a3(++_0x391bfd);}(_0x0784,0x196));var _0x4078=function(_0x4e89b7,_0x503c3a){_0x4e89b7=_0x4e89b7-0x0;var _0x3db882=_0x0784[_0x4e89b7];return _0x3db882;};'use strict';var express=require(_0x4078('0x0'));var favicon=require(_0x4078('0x1'));var bodyParser=require(_0x4078('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x4078('0x3'));var errorHandler=require('errorhandler');var path=require(_0x4078('0x4'));var passport=require(_0x4078('0x5'));var cors=require(_0x4078('0x6'));var moment=require(_0x4078('0x7'));var config=require(_0x4078('0x8'));var db=require(_0x4078('0x9'))['db'];exports[_0x4078('0xa')]=function(_0x11c62c){var _0x59bd66=_0x11c62c[_0x4078('0xb')](_0x4078('0xc'));if(_0x59bd66==='production'){_0x11c62c[_0x4078('0xd')](_0x4078('0xe'),path['join'](config['root'],'public'));}if(_0x59bd66==='development'||_0x59bd66===_0x4078('0xf')){_0x11c62c[_0x4078('0xd')](_0x4078('0xe'),path['join'](config[_0x4078('0x10')],_0x4078('0x11')));_0x11c62c['use'](errorHandler());}_0x11c62c[_0x4078('0xd')]('json\x20replacer',function(_0x4bb92d,_0x4d8e79){if(this[_0x4bb92d]instanceof Date){_0x4d8e79=this[_0x4bb92d][_0x4078('0x12')]()[_0x4078('0x13')]('.')[0x0]+'Z';}return _0x4d8e79;});_0x11c62c[_0x4078('0x14')](express[_0x4078('0x15')](_0x11c62c[_0x4078('0xb')](_0x4078('0xe'))));_0x11c62c['set']('views',config[_0x4078('0x10')]+_0x4078('0x16'));_0x11c62c[_0x4078('0x17')](_0x4078('0x18'),require(_0x4078('0x19'))[_0x4078('0x1a')]);_0x11c62c['set']('view\x20engine',_0x4078('0x18'));_0x11c62c[_0x4078('0x14')](bodyParser[_0x4078('0x1b')]({'limit':_0x4078('0x1c'),'extended':!![]}));_0x11c62c[_0x4078('0x14')](bodyParser['json']({'limit':_0x4078('0x1c')}));_0x11c62c[_0x4078('0x14')](cors());_0x11c62c[_0x4078('0x14')](methodOverride());_0x11c62c[_0x4078('0x14')](cookieParser());_0x11c62c['use'](passport[_0x4078('0x1d')]());};