a2782ebef42e310507dde4a59e26e3e3c2b04d59
[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 _0x6af1=['adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','../../config/environment','timeout','listen','port','socket.io','polling','redis','defaults','localhost'];(function(_0x2f6233,_0x90172){var _0x1c9c36=function(_0x3ac680){while(--_0x3ac680){_0x2f6233['push'](_0x2f6233['shift']());}};_0x1c9c36(++_0x90172);}(_0x6af1,0x1b5));var _0x16af=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6af1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x16af('0x0'));var http=require(_0x16af('0x1'));var express=require(_0x16af('0x2'));var sticky=require(_0x16af('0x3'));var Redis=require('ioredis');var config=require(_0x16af('0x4'));var app=express();var server=http['createServer'](app);server[_0x16af('0x5')]=0xdbba0;if(sticky[_0x16af('0x6')](server,config[_0x16af('0x7')])){var socketio=require(_0x16af('0x8'))(server,{'transports':['websocket',_0x16af('0x9')]});config[_0x16af('0xa')]=_[_0x16af('0xb')](config[_0x16af('0xa')],{'host':_0x16af('0xc'),'port':0x18eb});socketio[_0x16af('0xd')](require(_0x16af('0xe'))({'pubClient':new Redis(config[_0x16af('0xa')]),'subClient':new Redis(config[_0x16af('0xa')])}));require(_0x16af('0xf'))['default']();require(_0x16af('0x10'))[_0x16af('0x11')](socketio);require(_0x16af('0x12'))['default'](app);require(_0x16af('0x13'))[_0x16af('0x11')](app);}else{server[_0x16af('0x14')](_0x16af('0x15'),function(){console[_0x16af('0x16')](_0x16af('0x17'),config[_0x16af('0x7')]);});}exports=module[_0x16af('0x18')]=app;