Skip to content

Commit 6560a94

Browse files
committed
fix: update API_URI to API_URL for consistency in server.js
1 parent 4802863 commit 6560a94

File tree

2 files changed

+6
-6
lines changed
  • 01-contenedores/lemoncode-challenge

2 files changed

+6
-6
lines changed

01-contenedores/lemoncode-challenge/dotnet-stack/frontend/server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const express = require('express'),
44
app = express();
55
require('dotenv').config();
66

7-
const LOCAL = process.env.API_URI || 'http://localhost:5000/api/classes';
7+
const LOCAL = process.env.API_URL || 'http://localhost:5000/api/classes';
88
const PORT = 3000;
99
const APP_URL = `http://localhost:${PORT}`;
1010

@@ -20,7 +20,7 @@ app.use((req, res, next) => {
2020
app.get('/', async (req, res) => {
2121
try {
2222
//Recuperar clases de la API
23-
const apiUrl = process.env.API_URI || LOCAL;
23+
const apiUrl = process.env.API_URL || LOCAL;
2424
console.log(`🔄 Conectando a la API: ${apiUrl}`);
2525

2626
const response = await fetch(apiUrl);
@@ -35,7 +35,7 @@ app.get('/', async (req, res) => {
3535
});
3636

3737
const server = app.listen(PORT, () => {
38-
const apiUrl = process.env.API_URI || LOCAL;
38+
const apiUrl = process.env.API_URL || LOCAL;
3939
console.log('\n' + '='.repeat(70));
4040
console.log('🍋 LEMONCODE CALENDAR - FRONTEND SERVER');
4141
console.log('='.repeat(70));

01-contenedores/lemoncode-challenge/node-stack/frontend/server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const
55
app = express();
66
require('dotenv').config();
77

8-
const LOCAL = 'http://localhost:5000/api/classes';
8+
const LOCAL = process.env.API_URL || 'http://localhost:5000/api/classes';
99
const PORT = 3000;
1010
const APP_URL = `http://localhost:${PORT}`;
1111

@@ -21,7 +21,7 @@ app.use((req, res, next) => {
2121
app.get('/', async (req, res) => {
2222
try {
2323
//Recuperar clases de la API
24-
const apiUrl = process.env.API_URI || LOCAL;
24+
const apiUrl = process.env.API_URL || LOCAL;
2525
console.log(`🔄 Conectando a la API: ${apiUrl}`);
2626

2727
const response = await fetch(apiUrl);
@@ -36,7 +36,7 @@ app.get('/', async (req, res) => {
3636
});
3737

3838
const server = app.listen(PORT, () => {
39-
const apiUrl = process.env.API_URI || LOCAL;
39+
const apiUrl = process.env.API_URL || LOCAL;
4040
console.log('\n' + '='.repeat(70));
4141
console.log('🍋 LEMONCODE CALENDAR - FRONTEND SERVER');
4242
console.log('='.repeat(70));

0 commit comments

Comments
 (0)