- Go backend: Echo v4 + pgxpool + embedded golang-migrate; health endpoints at /health and /api/v1/health; TDD health handler (httptest) - Vue 3 frontend: Vite + TypeScript + Pinia + vue-router + Tailwind CSS v4; TDD HelloWorld component (@vue/test-utils + jsdom + vitest) - Infra: docker-compose postgres:16 with env-interpolated credentials; Makefile with dev-db health-wait loop, migrate-up/down, run, test, fmt - embed.FS migrations at backend/migrations/ (000001 no-op baseline) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
33 lines
872 B
Vue
33 lines
872 B
Vue
<script setup lang="ts">
|
|
import { ref, onMounted } from 'vue'
|
|
import { getHealth } from '../api/health'
|
|
|
|
const backendStatus = ref<string | null>(null)
|
|
const backendError = ref<string | null>(null)
|
|
|
|
onMounted(async () => {
|
|
try {
|
|
const data = await getHealth()
|
|
backendStatus.value = data.status
|
|
} catch (err) {
|
|
backendError.value = err instanceof Error ? err.message : 'unknown error'
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<main class="flex flex-col items-center justify-center min-h-screen gap-4">
|
|
<h1 class="text-4xl font-bold">Hello, OSDB!</h1>
|
|
|
|
<div v-if="backendStatus" class="text-green-600">
|
|
Backend: {{ backendStatus }}
|
|
</div>
|
|
<div v-else-if="backendError" class="text-red-600">
|
|
Backend unreachable: {{ backendError }}
|
|
</div>
|
|
<div v-else class="text-gray-400">
|
|
Checking backend…
|
|
</div>
|
|
</main>
|
|
</template>
|