Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/greeter-messages/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import express from 'express';
import { env, eureka } from '@greeting/shared';

const app = express();
const eurekaClient = await eureka.getClient(env.port);
const eurekaClient = await eureka.getClient();

app.get('/greeting', async (req, res) => {
const salutation = req.query.salutation || 'Hello';
Expand Down
2 changes: 1 addition & 1 deletion packages/greeter/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import express from 'express';
import { env, eureka } from '@greeting/shared';

const app = express();
const eurekaClient = await eureka.getClient(env.port);
const eurekaClient = await eureka.getClient();

// Counter for round-robin load balancing
let instanceCounter = 0;
Expand Down
6 changes: 3 additions & 3 deletions packages/shared/src/eureka.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Eureka } from 'eureka-js-client';
const addressInfo = services.getAddressInfo('p.service-registry');

// Initializes and returns a Eureka client.
const getClient = async (port) => {
const getClient = async () => {
const client = new Eureka({
// Auth configuration
requestMiddleware: async (requestOpts, done) => {
Expand All @@ -22,11 +22,11 @@ const getClient = async (port) => {
ipAddr: application.getInternalIpAddress(),
instanceId: `${application.getHostname()}:${application.getInstanceId() || '0'}`,
port: {
$: port,
$: 80,
'@enabled': true,
},
securePort: {
$: port,
$: 443,
'@enabled': true,
},
vipAddress: 'UNKNOWN',
Expand Down