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