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