Docker compose almost working

This commit is contained in:
Laurent
2024-10-23 23:01:11 +02:00
parent a66035d1f5
commit e6a6bf274b
57 changed files with 906 additions and 169 deletions

View File

@@ -6,6 +6,10 @@
<ul class="leaderboard">
{#if scores.length === 0}
No scores for now...
{/if}
{#each scores as score, i}
<li class="item">
<div class="name"><img src="" alt=""/> {score.owner} </div><div class="score"> {score.value} pts.</div>

View File

@@ -1,8 +1,10 @@
import {scoreStore} from "./scoreStore";
import {Score} from "../models/score";
const api_url = import.meta.env.VITE_API_URL
export async function submitScore(owner: string, value : number){
return await handleRequest("http://localhost:8080/api/submit/",
return await handleRequest(`${api_url}/submit/`,
{
method:"POST",
body : JSON.stringify({owner:owner, value:value}),
@@ -11,7 +13,7 @@ export async function submitScore(owner: string, value : number){
}
export async function getLeaderboard(){
return await handleRequest("http://localhost:8080/api/leaderboard",
return await handleRequest(`${api_url}/leaderboard/`,
{ method:"GET" });
}