Built motion from commit 9d7072cc.|2.5.39
[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 _0x79e6=['websocket','redis','defaults','socket.io-redis','../../config/triggers','../../config/socketio','default','../../routes','once','listening','lodash','http','express','sticky-session','../../config/environment','createServer','timeout','socket.io'];(function(_0x158f9b,_0x30d3d2){var _0x11268f=function(_0x2b6c61){while(--_0x2b6c61){_0x158f9b['push'](_0x158f9b['shift']());}};_0x11268f(++_0x30d3d2);}(_0x79e6,0xbe));var _0x679e=function(_0x6b6157,_0xc2e4a8){_0x6b6157=_0x6b6157-0x0;var _0x417595=_0x79e6[_0x6b6157];return _0x417595;};'use strict';var _=require(_0x679e('0x0'));var http=require(_0x679e('0x1'));var express=require(_0x679e('0x2'));var sticky=require(_0x679e('0x3'));var Redis=require('ioredis');var config=require(_0x679e('0x4'));var app=express();var server=http[_0x679e('0x5')](app);server[_0x679e('0x6')]=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0x679e('0x7'))(server,{'transports':[_0x679e('0x8'),'polling']});config[_0x679e('0x9')]=_[_0x679e('0xa')](config['redis'],{'host':'localhost','port':0x18eb});socketio['adapter'](require(_0x679e('0xb'))({'pubClient':new Redis(config[_0x679e('0x9')]),'subClient':new Redis(config[_0x679e('0x9')])}));require(_0x679e('0xc'))['default']();require(_0x679e('0xd'))[_0x679e('0xe')](socketio);require('../../config/express')['default'](app);require(_0x679e('0xf'))['default'](app);}else{server[_0x679e('0x10')](_0x679e('0x11'),function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module['exports']=app;