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