Built motion from commit 4fa9d4a7.|2.6.31
[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 _0xb6e6=['../../config/triggers','default','../../config/socketio','../../config/express','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','http','express','ioredis','../../config/environment','timeout','port','socket.io','websocket','polling','redis','defaults','socket.io-redis'];(function(_0x4f08dd,_0x3784ec){var _0x3017ee=function(_0x7d95be){while(--_0x7d95be){_0x4f08dd['push'](_0x4f08dd['shift']());}};_0x3017ee(++_0x3784ec);}(_0xb6e6,0x137));var _0x6b6e=function(_0x5bcaf4,_0x247046){_0x5bcaf4=_0x5bcaf4-0x0;var _0x1ea601=_0xb6e6[_0x5bcaf4];return _0x1ea601;};'use strict';var _=require('lodash');var http=require(_0x6b6e('0x0'));var express=require(_0x6b6e('0x1'));var sticky=require('sticky-session');var Redis=require(_0x6b6e('0x2'));var config=require(_0x6b6e('0x3'));var app=express();var server=http['createServer'](app);server[_0x6b6e('0x4')]=0xdbba0;if(sticky['listen'](server,config[_0x6b6e('0x5')])){var socketio=require(_0x6b6e('0x6'))(server,{'transports':[_0x6b6e('0x7'),_0x6b6e('0x8')]});config[_0x6b6e('0x9')]=_[_0x6b6e('0xa')](config['redis'],{'host':'localhost','port':0x18eb});socketio['adapter'](require(_0x6b6e('0xb'))({'pubClient':new Redis(config[_0x6b6e('0x9')]),'subClient':new Redis(config['redis'])}));require(_0x6b6e('0xc'))[_0x6b6e('0xd')]();require(_0x6b6e('0xe'))[_0x6b6e('0xd')](socketio);require(_0x6b6e('0xf'))[_0x6b6e('0xd')](app);require('../../routes')['default'](app);}else{server['once'](_0x6b6e('0x10'),function(){console[_0x6b6e('0x11')](_0x6b6e('0x12'),config[_0x6b6e('0x5')]);});}exports=module['exports']=app;