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