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