From 460bdf8e1c7b456e220ebb4278ced6c4f5ba2b36 Mon Sep 17 00:00:00 2001 From: Ziedelth Date: Tue, 22 Mar 2022 17:52:42 +0100 Subject: [PATCH] Add request --- .gitignore | 1 + src/main/resources/hibernate.cfg.xml | 29 ---------------------------- src/main/webapp/js/main.js | 12 ++++++++---- 3 files changed, 9 insertions(+), 33 deletions(-) delete mode 100644 src/main/resources/hibernate.cfg.xml diff --git a/.gitignore b/.gitignore index 2d513a0..a2b99ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /.idea/ /target/ +/src/main/resources/hibernate.cfg.xml diff --git a/src/main/resources/hibernate.cfg.xml b/src/main/resources/hibernate.cfg.xml deleted file mode 100644 index 8bfcb25..0000000 --- a/src/main/resources/hibernate.cfg.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - org.hibernate.dialect.MariaDBDialect - - - - org.mariadb.jdbc.Driver - - - - - - jdbc:mariadb://localhost:3306/filmflix - - - - filmflix - - - - filmflix - - - \ No newline at end of file diff --git a/src/main/webapp/js/main.js b/src/main/webapp/js/main.js index 36f4b98..31f59be 100644 --- a/src/main/webapp/js/main.js +++ b/src/main/webapp/js/main.js @@ -1,11 +1,15 @@ $(document).ready(function () { console.log("OK"); - $("#films").append(generateFilmCard("lorem", "lorem")); + // $("#films").append(generateFilmCard("lorem", "lorem")); - // $.get("https://ziedelth.fr/api/v1/country/fr/page/1/limit/9/episodes", function (data) { - // console.table(data); - // }); + $.get("http://localhost:8080/api/film", function (data) { + console.table(data); + + for (let dataKey of data) { + $("#films").append(generateFilmCard(dataKey.name, dataKey.description)); + } + }); }); function generateFilmCard(title, description) {