389fb80d6403ac6c566e200cf60071d1b12a116c
[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 _0xa4ba=['createServer','listen','port','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/express','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','sticky-session'];(function(_0x552c74,_0x115368){var _0x1abed3=function(_0x1704d7){while(--_0x1704d7){_0x552c74['push'](_0x552c74['shift']());}};_0x1abed3(++_0x115368);}(_0xa4ba,0xb8));var _0xaa4b=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xa4ba[_0x36884e];return _0x1cc367;};'use strict';var _=require('lodash');var http=require(_0xaa4b('0x0'));var express=require(_0xaa4b('0x1'));var sticky=require(_0xaa4b('0x2'));var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http[_0xaa4b('0x3')](app);server['timeout']=0xdbba0;if(sticky[_0xaa4b('0x4')](server,config[_0xaa4b('0x5')])){var socketio=require('socket.io')(server,{'transports':['websocket',_0xaa4b('0x6')]});config[_0xaa4b('0x7')]=_[_0xaa4b('0x8')](config['redis'],{'host':_0xaa4b('0x9'),'port':0x18eb});socketio[_0xaa4b('0xa')](require(_0xaa4b('0xb'))({'pubClient':new Redis(config[_0xaa4b('0x7')]),'subClient':new Redis(config['redis'])}));require(_0xaa4b('0xc'))['default']();require('../../config/socketio')[_0xaa4b('0xd')](socketio);require(_0xaa4b('0xe'))[_0xaa4b('0xd')](app);require('../../routes')['default'](app);}else{server['once']('listening',function(){console['log'](_0xaa4b('0xf'),config[_0xaa4b('0x5')]);});}exports=module[_0xaa4b('0x10')]=app;