add jquery (broken)

This commit is contained in:
agatha 2024-04-06 18:14:17 -04:00
parent 221dbba3be
commit ebea9faabf
4 changed files with 20 additions and 1 deletions

View File

@ -14,5 +14,9 @@ http {
location / {
try_files $uri $uri/ =404;
}
location /api {
proxy_pass http://backend:8000/;
}
}
}

View File

@ -0,0 +1,10 @@
const apiUrl = 'http://localhost:8000/api';
function getCatalog() {
$.getJSON(apiUrl + "/catalog", function (resp) {
document.write(resp.text);
})
}
$( document ).ready(function() {
getCatalog();
});

File diff suppressed because one or more lines are too long

View File

@ -4,11 +4,14 @@
<title>Single-board Forum</title>
<link rel="stylesheet" href="assets/css/main.css">
<meta charset="UTF-8">
<script src="assets/js/app.js" type="module"></script>
<script src="assets/js/jquery-3.7.1.min.js"></script>
<script src="assets/js/app.js" defer></script>
</head>
<body>
<header>
<h1>Single-board Forum</h1>
</header>
<div class="posts">
</div>
</body>
</html>