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