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,11 +5,11 @@ export type LOARequest = {
end_date: string; // ISO 8601 string
reason?: string;
};
const addr = "localhost:3000";
// @ts-ignore
const addr = import.meta.env.VITE_APIHOST;
export async function submitLOA(request: LOARequest): Promise<{ id?: number; error?: string }> {
const res = await fetch(`http://${addr}/loa`, {
const res = await fetch(`${addr}/loa`, {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -25,7 +25,7 @@ export async function submitLOA(request: LOARequest): Promise<{ id?: number; err
}
export async function getMyLOA(): Promise<LOARequest | null> {
const res = await fetch(`http://${addr}/loa/me`, {
const res = await fetch(`${addr}/loa/me`, {
method: "GET",
headers: {
"Content-Type": "application/json",