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