abc3f11123a32a7ef223730de5fb69494541c301
[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 _0x28ca=['sticky-session','../../config/environment','createServer','timeout','socket.io','websocket','polling','redis','defaults','localhost','adapter','../../config/triggers','default','../../config/socketio','../../routes','once','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http','express'];(function(_0x1bfea4,_0x24dfbb){var _0x5327df=function(_0x53695d){while(--_0x53695d){_0x1bfea4['push'](_0x1bfea4['shift']());}};_0x5327df(++_0x24dfbb);}(_0x28ca,0x189));var _0xa28c=function(_0x3a926c,_0x5675cb){_0x3a926c=_0x3a926c-0x0;var _0x44e727=_0x28ca[_0x3a926c];return _0x44e727;};'use strict';var _=require(_0xa28c('0x0'));var http=require(_0xa28c('0x1'));var express=require(_0xa28c('0x2'));var sticky=require(_0xa28c('0x3'));var Redis=require('ioredis');var config=require(_0xa28c('0x4'));var app=express();var server=http[_0xa28c('0x5')](app);server[_0xa28c('0x6')]=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0xa28c('0x7'))(server,{'transports':[_0xa28c('0x8'),_0xa28c('0x9')]});config[_0xa28c('0xa')]=_[_0xa28c('0xb')](config[_0xa28c('0xa')],{'host':_0xa28c('0xc'),'port':0x18eb});socketio[_0xa28c('0xd')](require('socket.io-redis')({'pubClient':new Redis(config[_0xa28c('0xa')]),'subClient':new Redis(config[_0xa28c('0xa')])}));require(_0xa28c('0xe'))[_0xa28c('0xf')]();require(_0xa28c('0x10'))[_0xa28c('0xf')](socketio);require('../../config/express')[_0xa28c('0xf')](app);require(_0xa28c('0x11'))[_0xa28c('0xf')](app);}else{server[_0xa28c('0x12')]('listening',function(){console['log'](_0xa28c('0x13'),config[_0xa28c('0x14')]);});}exports=module[_0xa28c('0x15')]=app;