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