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