Serve SPA from API and add health endpoint

Switch backend to serve the built SPA and static assets, add a minimal health endpoint, and clean up template code. Changes: added API/Controllers/HealthController.cs (GET /api/health -> 200), removed WeatherForecast controller and model, removed OpenAPI package reference and OpenAPI wiring from API.csproj/Program.cs, updated Program.cs to serve wwwroot with default files/static files and a SPA fallback that returns index.html for non-/api routes (/api/* returns 404), updated GUI/vite.config.ts to output build to API/wwwroot and clear the directory, added API/wwwroot to .gitignore, and updated codexInfo.md to document these changes. This enables the GUI build to be deployed directly into the API project and served as a single-page app.
This commit is contained in:
Jonas
2026-04-18 12:45:02 +02:00
parent 36ba210323
commit 522d31dc6e
8 changed files with 47 additions and 56 deletions
+4
View File
@@ -10,6 +10,10 @@ export default defineConfig({
vue(),
vueDevTools(),
],
build: {
outDir: fileURLToPath(new URL('../API/wwwroot', import.meta.url)),
emptyOutDir: true,
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))