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