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