a101814323bd65b59fabbc14fa00f9ffcddbd7cd
[motion2.git] / server / services / express / index.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 _0x8b4f=['redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','sticky-session','../../config/environment','createServer','port','socket.io','websocket','polling'];(function(_0x524788,_0x35a483){var _0x1f46d2=function(_0x5a6b5d){while(--_0x5a6b5d){_0x524788['push'](_0x524788['shift']());}};_0x1f46d2(++_0x35a483);}(_0x8b4f,0x11d));var _0xf8b4=function(_0x28e2cd,_0x153b42){_0x28e2cd=_0x28e2cd-0x0;var _0x11fd46=_0x8b4f[_0x28e2cd];return _0x11fd46;};'use strict';var _=require('lodash');var http=require(_0xf8b4('0x0'));var express=require(_0xf8b4('0x1'));var sticky=require(_0xf8b4('0x2'));var Redis=require('ioredis');var config=require(_0xf8b4('0x3'));var app=express();var server=http[_0xf8b4('0x4')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0xf8b4('0x5')])){var socketio=require(_0xf8b4('0x6'))(server,{'transports':[_0xf8b4('0x7'),_0xf8b4('0x8')]});config['redis']=_['defaults'](config[_0xf8b4('0x9')],{'host':_0xf8b4('0xa'),'port':0x18eb});socketio[_0xf8b4('0xb')](require(_0xf8b4('0xc'))({'pubClient':new Redis(config[_0xf8b4('0x9')]),'subClient':new Redis(config[_0xf8b4('0x9')])}));require(_0xf8b4('0xd'))[_0xf8b4('0xe')]();require('../../config/socketio')['default'](socketio);require('../../config/express')[_0xf8b4('0xe')](app);require(_0xf8b4('0xf'))[_0xf8b4('0xe')](app);}else{server[_0xf8b4('0x10')](_0xf8b4('0x11'),function(){console[_0xf8b4('0x12')](_0xf8b4('0x13'),config[_0xf8b4('0x5')]);});}exports=module[_0xf8b4('0x14')]=app;