Docker compose almost working
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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" });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user