Use relative API paths for Tailscale access

Replaced hardcoded http://localhost:8420/api with /api so the
frontend works from any host (Tailscale, LAN, etc).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Gros Frumos 2026-03-15 17:13:37 +02:00
parent 3ef00bced1
commit 03961500e6
2 changed files with 2 additions and 2 deletions

View file

@ -1,4 +1,4 @@
const BASE = 'http://localhost:8420/api' const BASE = '/api'
async function get<T>(path: string): Promise<T> { async function get<T>(path: string): Promise<T> {
const res = await fetch(`${BASE}${path}`) const res = await fetch(`${BASE}${path}`)

View file

@ -133,7 +133,7 @@ async function addDecision() {
category: decForm.value.category || undefined, category: decForm.value.category || undefined,
tags, tags,
} }
const res = await fetch('http://localhost:8420/api/decisions', { const res = await fetch('/api/decisions', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body), body: JSON.stringify(body),