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