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