92eb401efb235ee65aff892ae4a3bc70841d1484
[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 _0xf8a0=['socket.io-redis','../../config/socketio','../../config/express','default','once','listening','log','exports','lodash','express','sticky-session','ioredis','createServer','port','socket.io','redis','defaults','adapter'];(function(_0x531df0,_0x2af6bb){var _0x4b723a=function(_0x20f798){while(--_0x20f798){_0x531df0['push'](_0x531df0['shift']());}};_0x4b723a(++_0x2af6bb);}(_0xf8a0,0x98));var _0x0f8a=function(_0x3df3c6,_0x496e1a){_0x3df3c6=_0x3df3c6-0x0;var _0x254c43=_0xf8a0[_0x3df3c6];return _0x254c43;};'use strict';var _=require(_0x0f8a('0x0'));var http=require('http');var express=require(_0x0f8a('0x1'));var sticky=require(_0x0f8a('0x2'));var Redis=require(_0x0f8a('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0x0f8a('0x4')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0x0f8a('0x5')])){var socketio=require(_0x0f8a('0x6'))(server,{'transports':['websocket','polling']});config[_0x0f8a('0x7')]=_[_0x0f8a('0x8')](config[_0x0f8a('0x7')],{'host':'localhost','port':0x18eb});socketio[_0x0f8a('0x9')](require(_0x0f8a('0xa'))({'pubClient':new Redis(config[_0x0f8a('0x7')]),'subClient':new Redis(config[_0x0f8a('0x7')])}));require('../../config/triggers')['default']();require(_0x0f8a('0xb'))['default'](socketio);require(_0x0f8a('0xc'))['default'](app);require('../../routes')[_0x0f8a('0xd')](app);}else{server[_0x0f8a('0xe')](_0x0f8a('0xf'),function(){console[_0x0f8a('0x10')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x0f8a('0x5')]);});}exports=module[_0x0f8a('0x11')]=app;