Skip to content

Commit ca5e8ac

Browse files
committed
fix: fixes both secure and unsecure ports
Signed-off-by: kvmw <[email protected]>
1 parent 7626fb3 commit ca5e8ac

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/greeter-messages/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import express from 'express';
22
import { env, eureka } from '@greeting/shared';
33

44
const app = express();
5-
const eurekaClient = await eureka.getClient(env.port);
5+
const eurekaClient = await eureka.getClient();
66

77
app.get('/greeting', async (req, res) => {
88
const salutation = req.query.salutation || 'Hello';

packages/greeter/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import express from 'express';
22
import { env, eureka } from '@greeting/shared';
33

44
const app = express();
5-
const eurekaClient = await eureka.getClient(env.port);
5+
const eurekaClient = await eureka.getClient();
66

77
// Counter for round-robin load balancing
88
let instanceCounter = 0;

packages/shared/src/eureka.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Eureka } from 'eureka-js-client';
66
const addressInfo = services.getAddressInfo('p.service-registry');
77

88
// Initializes and returns a Eureka client.
9-
const getClient = async (port) => {
9+
const getClient = async () => {
1010
const client = new Eureka({
1111
// Auth configuration
1212
requestMiddleware: async (requestOpts, done) => {
@@ -22,11 +22,11 @@ const getClient = async (port) => {
2222
ipAddr: application.getInternalIpAddress(),
2323
instanceId: `${application.getHostname()}:${application.getInstanceId() || '0'}`,
2424
port: {
25-
$: port,
25+
$: 80,
2626
'@enabled': true,
2727
},
2828
securePort: {
29-
$: port,
29+
$: 443,
3030
'@enabled': true,
3131
},
3232
vipAddress: 'UNKNOWN',

0 commit comments

Comments
 (0)