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