Did a whole ton of stuff, notably cloudflare tunnel hosting

This commit is contained in:
2025-09-18 20:31:34 -04:00
parent 0f7faa499d
commit 4fcd485e75
7 changed files with 87 additions and 24 deletions

View File

@@ -5,12 +5,11 @@ export type Rank = {
sortOrder: number
}
const addr = "localhost:3000"
// @ts-ignore
const addr = import.meta.env.VITE_APIHOST;
// Placeholder: fetch list of ranks
export async function getRanks(): Promise<Rank[]> {
const res = await fetch(`http://${addr}/ranks`)
const res = await fetch(`${addr}/ranks`)
if (res.ok) {
return res.json()
@@ -22,7 +21,7 @@ export async function getRanks(): Promise<Rank[]> {
// Placeholder: submit a rank change
export async function submitRankChange(memberId: number, rankId: number): Promise<{ ok: boolean }> {
const res = await fetch(`http://${addr}/rank`, {
const res = await fetch(`${addr}/rank`, {
method: "POST",
headers: {
"Content-Type": "application/json",