Built motion from commit (unavailable).|2.5.14
[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 _0xbd53=['createServer','timeout','listen','port','socket.io','websocket','polling','redis','adapter','../../config/triggers','default','../../config/socketio','../../config/express','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','sticky-session','../../config/environment'];(function(_0x45ae93,_0x3fc5e1){var _0x1a5c22=function(_0x5f7531){while(--_0x5f7531){_0x45ae93['push'](_0x45ae93['shift']());}};_0x1a5c22(++_0x3fc5e1);}(_0xbd53,0xfa));var _0x3bd5=function(_0x50a67c,_0x59f3be){_0x50a67c=_0x50a67c-0x0;var _0x4f00e2=_0xbd53[_0x50a67c];return _0x4f00e2;};'use strict';var _=require('lodash');var http=require('http');var express=require('express');var sticky=require(_0x3bd5('0x0'));var Redis=require('ioredis');var config=require(_0x3bd5('0x1'));var app=express();var server=http[_0x3bd5('0x2')](app);server[_0x3bd5('0x3')]=0xdbba0;if(sticky[_0x3bd5('0x4')](server,config[_0x3bd5('0x5')])){var socketio=require(_0x3bd5('0x6'))(server,{'transports':[_0x3bd5('0x7'),_0x3bd5('0x8')]});config[_0x3bd5('0x9')]=_['defaults'](config[_0x3bd5('0x9')],{'host':'localhost','port':0x18eb});socketio[_0x3bd5('0xa')](require('socket.io-redis')({'pubClient':new Redis(config[_0x3bd5('0x9')]),'subClient':new Redis(config[_0x3bd5('0x9')])}));require(_0x3bd5('0xb'))[_0x3bd5('0xc')]();require(_0x3bd5('0xd'))[_0x3bd5('0xc')](socketio);require(_0x3bd5('0xe'))[_0x3bd5('0xc')](app);require('../../routes')[_0x3bd5('0xc')](app);}else{server[_0x3bd5('0xf')](_0x3bd5('0x10'),function(){console['log'](_0x3bd5('0x11'),config[_0x3bd5('0x5')]);});}exports=module['exports']=app;