Skip to content

Commit 3b32c9c

Browse files
author
Asier Cidon
committedJan 10, 2021
Added internal microservices environment variables
1 parent 7f6e093 commit 3b32c9c

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed
 

‎src/infrastructure/postJump.tsx

+1-8
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@ export const sentJump = async (
77
url: string,
88
data: Jump
99
): Promise<ResponseBack> => {
10-
// Define Axios Instance
11-
const instance: AxiosInstance = axios.create({
12-
httpsAgent: new https.Agent({
13-
rejectUnauthorized: false,
14-
}),
15-
});
16-
1710
// Define options with headers
1811
const options = {
1912
headers: {
@@ -25,7 +18,7 @@ export const sentJump = async (
2518
// Execute Post
2619
try {
2720
let response: any;
28-
response = await instance.post(url, JSON.stringify(data), options);
21+
response = await axios.post(url, JSON.stringify(data), options);
2922
return response.data;
3023
} catch (error) {
3124
console.log(error);

‎src/ui/home/Home.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,27 @@ const cx = bind(styles);
1212
interface Props {}
1313

1414
export const Home: React.FunctionComponent<Props> = () => {
15-
const appBack = process.env.REACT_APP_BACK + '';
15+
const appBack = process.env.REACT_APP_BACK || '';
16+
const appGolang = process.env.REACT_APP_GOLANG || 'http://golang:8442';
17+
const appSpringboot =
18+
process.env.REACT_APP_SPRINGBOOT || 'http://springboot:8443';
19+
const appPython = process.env.REACT_APP_PYTHON || 'http://python:8444';
1620

1721
const golang = {
1822
id: '1',
19-
jump: 'http://golang:8442',
23+
jump: appGolang,
2024
name: 'Golang',
2125
img: './golang.png',
2226
};
2327
const springboot = {
2428
id: '2',
25-
jump: 'http://springboot:8443',
29+
jump: appSpringboot,
2630
name: 'Springboot',
2731
img: './springboot.png',
2832
};
2933
const python = {
3034
id: '3',
31-
jump: 'http://python:5000',
35+
jump: appPython,
3236
name: 'Python',
3337
img: './python.png',
3438
};

0 commit comments

Comments
 (0)
Please sign in to comment.