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