Skip to content

Commit

Permalink
connect to hosted stats API in production
Browse files Browse the repository at this point in the history
  • Loading branch information
jakmeier committed Dec 26, 2023
1 parent 1fb102c commit a69085e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
10 changes: 8 additions & 2 deletions bouncy_frontend/src/lib/stats.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
// TODO: for production, point to hosted site
const STATS_API_BASE = "http://localhost:3000";
import { dev } from "$app/environment";

// TODO: This is a temporary place to host the stats service
let STATS_API_BASE = "https://demo.paddlers.ch:3000";

if (dev) {
STATS_API_BASE = "http://localhost:3000";
}

/**
* @param {{ id: string; publicName: string; recordedSteps: number; recordedSeconds: number; recordedDances: number; }} user
Expand Down
5 changes: 4 additions & 1 deletion bouncy_frontend/src/routes/profile/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
}
async function refreshLeaderboard() {
scoreboardData = await fetchLeaderboard();
let result = await fetchLeaderboard();
if(result) {
scoreboardData = result;
}
}
refreshLeaderboard();
</script>
Expand Down
11 changes: 11 additions & 0 deletions bouncy_stats/docker-compose.hosted.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "3.6"
services:
bouncy_stats:
image: jakmeier/bouncy-feet:bouncy_stats
volumes:
- data:/app/db.sqlite
ports:
- 3000:3000
volumes:
data:
external: false

0 comments on commit a69085e

Please sign in to comment.