Skip to content

Commit a167d8c

Browse files
committed
prueba de ruta para archivo json
1 parent 0964c25 commit a167d8c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

js/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,20 @@ document.addEventListener('DOMContentLoaded', async function () {
33
try {
44
async function consumirApiProductos() {
55
try {
6-
const respuesta = await fetch('./js/productos.json');
6+
const respuesta = await fetch('../js/productos.json');
77
const datos = await respuesta.json();
88
return datos;
99
} catch (error) {
10-
console.error("Error al consumir la primera API:", error);
1110
return [];
1211
}
1312
}
1413

1514
async function consumirApiProductosCarrete() {
1615
try {
17-
const respuesta = await fetch('./js/productosCarrete.json');
16+
const respuesta = await fetch('../js/productosCarrete.json');
1817
const datos = await respuesta.json();
1918
return datos;
2019
} catch (error) {
21-
console.error("Error al consumir la segunda API:", error);
2220
return [];
2321
}
2422
}

0 commit comments

Comments
 (0)