Built motion from commit db94841.|2.5.3
[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 _0x1f9a=['socket.io-redis','default','../../config/socketio','../../config/express','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http','sticky-session','ioredis','../../config/environment','timeout','listen','socket.io','websocket','polling','redis','defaults','localhost','adapter'];(function(_0x2cd3c4,_0x15f9fb){var _0x14dde6=function(_0x4147fd){while(--_0x4147fd){_0x2cd3c4['push'](_0x2cd3c4['shift']());}};_0x14dde6(++_0x15f9fb);}(_0x1f9a,0x106));var _0xa1f9=function(_0x146a4f,_0x2c6f27){_0x146a4f=_0x146a4f-0x0;var _0x4c545e=_0x1f9a[_0x146a4f];return _0x4c545e;};'use strict';var _=require(_0xa1f9('0x0'));var http=require(_0xa1f9('0x1'));var express=require('express');var sticky=require(_0xa1f9('0x2'));var Redis=require(_0xa1f9('0x3'));var config=require(_0xa1f9('0x4'));var app=express();var server=http['createServer'](app);server[_0xa1f9('0x5')]=0xdbba0;if(sticky[_0xa1f9('0x6')](server,config['port'])){var socketio=require(_0xa1f9('0x7'))(server,{'transports':[_0xa1f9('0x8'),_0xa1f9('0x9')]});config[_0xa1f9('0xa')]=_[_0xa1f9('0xb')](config[_0xa1f9('0xa')],{'host':_0xa1f9('0xc'),'port':0x18eb});socketio[_0xa1f9('0xd')](require(_0xa1f9('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xa1f9('0xa')])}));require('../../config/triggers')[_0xa1f9('0xf')]();require(_0xa1f9('0x10'))['default'](socketio);require(_0xa1f9('0x11'))[_0xa1f9('0xf')](app);require('../../routes')[_0xa1f9('0xf')](app);}else{server[_0xa1f9('0x12')](_0xa1f9('0x13'),function(){console['log'](_0xa1f9('0x14'),config[_0xa1f9('0x15')]);});}exports=module[_0xa1f9('0x16')]=app;