-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tratando de arreglar fetch y controller
- Loading branch information
1 parent
eaf0796
commit aa48fe3
Showing
3 changed files
with
165 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
package controllers; | ||
|
||
import java.util.Arrays; | ||
import io.javalin.http.Context; | ||
import java.util.List; | ||
|
||
public class EntidadController { | ||
|
||
public static void getEntidades(Context ctx) { | ||
// Lógica para obtener y devolver la lista de entidades | ||
// Lógica para obtener las entidades desde tu backend | ||
// Por ejemplo: | ||
List<String> listaDeEntidades = obtenerListaDeEntidades(); | ||
|
||
// Devolver las entidades como JSON | ||
ctx.json(listaDeEntidades); | ||
} | ||
|
||
private static List<String> obtenerListaDeEntidades() { | ||
// Lógica para obtener las entidades desde tu base de datos o en memoria | ||
// Por ejemplo: | ||
return List.of("Entidad1", "Entidad2", "Entidad3"); | ||
} | ||
} | ||
|