7672b51e09840d129a440253287ae15133df0680
[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 _0xd860=['exports','lodash','http','express','sticky-session','../../config/environment','createServer','timeout','listen','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','default','../../config/socketio','../../config/express','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port'];(function(_0x3415ed,_0x5f8fea){var _0x503ea2=function(_0x3eca57){while(--_0x3eca57){_0x3415ed['push'](_0x3415ed['shift']());}};_0x503ea2(++_0x5f8fea);}(_0xd860,0x1cd));var _0x0d86=function(_0x298762,_0x333068){_0x298762=_0x298762-0x0;var _0x38e391=_0xd860[_0x298762];return _0x38e391;};'use strict';var _=require(_0x0d86('0x0'));var http=require(_0x0d86('0x1'));var express=require(_0x0d86('0x2'));var sticky=require(_0x0d86('0x3'));var Redis=require('ioredis');var config=require(_0x0d86('0x4'));var app=express();var server=http[_0x0d86('0x5')](app);server[_0x0d86('0x6')]=0xdbba0;if(sticky[_0x0d86('0x7')](server,config['port'])){var socketio=require('socket.io')(server,{'transports':[_0x0d86('0x8'),_0x0d86('0x9')]});config[_0x0d86('0xa')]=_[_0x0d86('0xb')](config['redis'],{'host':_0x0d86('0xc'),'port':0x18eb});socketio[_0x0d86('0xd')](require(_0x0d86('0xe'))({'pubClient':new Redis(config[_0x0d86('0xa')]),'subClient':new Redis(config[_0x0d86('0xa')])}));require('../../config/triggers')[_0x0d86('0xf')]();require(_0x0d86('0x10'))['default'](socketio);require(_0x0d86('0x11'))[_0x0d86('0xf')](app);require('../../routes')[_0x0d86('0xf')](app);}else{server['once'](_0x0d86('0x12'),function(){console[_0x0d86('0x13')](_0x0d86('0x14'),config[_0x0d86('0x15')]);});}exports=module[_0x0d86('0x16')]=app;