2e2fd8a92492b7685b63221921c6e2a940cc27f2
[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 _0xc155=['passport','cors','./environment','default','get','env','production','set','appPath','join','root','public','development','test','use','json\x20replacer','views','/server/views','engine','html','ejs','view\x20engine','urlencoded','initialize','express','method-override','cookie-parser','path'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0xc155,0xc0));var _0x5c15=function(_0xae83bf,_0x147e3a){_0xae83bf=_0xae83bf-0x0;var _0x142d96=_0xc155[_0xae83bf];return _0x142d96;};'use strict';var express=require(_0x5c15('0x0'));var favicon=require('serve-favicon');var bodyParser=require('body-parser');var methodOverride=require(_0x5c15('0x1'));var cookieParser=require(_0x5c15('0x2'));var errorHandler=require('errorhandler');var path=require(_0x5c15('0x3'));var passport=require(_0x5c15('0x4'));var cors=require(_0x5c15('0x5'));var moment=require('moment');var config=require(_0x5c15('0x6'));var db=require('../mysqldb')['db'];exports[_0x5c15('0x7')]=function(_0x1823f8){var _0x4a62fa=_0x1823f8[_0x5c15('0x8')](_0x5c15('0x9'));if(_0x4a62fa===_0x5c15('0xa')){_0x1823f8[_0x5c15('0xb')](_0x5c15('0xc'),path[_0x5c15('0xd')](config[_0x5c15('0xe')],_0x5c15('0xf')));}if(_0x4a62fa===_0x5c15('0x10')||_0x4a62fa===_0x5c15('0x11')){_0x1823f8[_0x5c15('0xb')]('appPath',path['join'](config[_0x5c15('0xe')],'client'));_0x1823f8[_0x5c15('0x12')](errorHandler());}_0x1823f8[_0x5c15('0xb')](_0x5c15('0x13'),function(_0x439996,_0x254067){if(this[_0x439996]instanceof Date){_0x254067=this[_0x439996]['toISOString']()['split']('.')[0x0]+'Z';}return _0x254067;});_0x1823f8[_0x5c15('0x12')](express['static'](_0x1823f8[_0x5c15('0x8')](_0x5c15('0xc'))));_0x1823f8[_0x5c15('0xb')](_0x5c15('0x14'),config[_0x5c15('0xe')]+_0x5c15('0x15'));_0x1823f8[_0x5c15('0x16')](_0x5c15('0x17'),require(_0x5c15('0x18'))['renderFile']);_0x1823f8[_0x5c15('0xb')](_0x5c15('0x19'),'html');_0x1823f8[_0x5c15('0x12')](bodyParser[_0x5c15('0x1a')]({'limit':'50mb','extended':!![]}));_0x1823f8[_0x5c15('0x12')](bodyParser['json']({'limit':'50mb'}));_0x1823f8[_0x5c15('0x12')](cors());_0x1823f8['use'](methodOverride());_0x1823f8[_0x5c15('0x12')](cookieParser());_0x1823f8[_0x5c15('0x12')](passport[_0x5c15('0x1b')]());};