Reorganize the Web App to match the GsmNode project layout: a Go backend-for-frontend in server/ that embeds the built SPA and reverse-proxies /api/* to the API Server, with the Vue 3 + Vite frontend moved into web/. - Move all frontend files into web/ (history preserved via renames) - Point vite build output at ../server/dist for Go embedding - Add server/ Go BFF (main.go, go.mod, .env.example, Run-WebApp.ps1) - Drop Docker/nginx deploy (Dockerfile, docker-compose.yml, nginx.conf.template, .dockerignore) in favor of the BFF, matching GsmNode - Update .claude/launch.json to run the dev server from web/ - Rewrite README.md for the new layout Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
30 lines
1011 B
JavaScript
30 lines
1011 B
JavaScript
import { defineConfig } from "vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
// The web app talks ONLY to the API Server. The production build is written into
|
|
// ../server/dist so the Go BFF can embed it. In dev, /api is proxied to the API
|
|
// Server so we avoid CORS and can use same-origin relative URLs in the client.
|
|
export default defineConfig({
|
|
plugins: [vue(), tailwindcss()],
|
|
build: {
|
|
outDir: "../server/dist",
|
|
emptyOutDir: true,
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
// Listen on all interfaces so the dev server is reachable on the LAN
|
|
// (e.g. http://10.2.1.101:5173 from another device).
|
|
host: true,
|
|
// Allow access via the LAN hostname/IP (Vite's host check otherwise blocks
|
|
// non-localhost Host headers). true = accept any host (fine for LAN dev).
|
|
allowedHosts: true,
|
|
proxy: {
|
|
"/api": {
|
|
target: process.env.VITE_API_TARGET || "http://localhost:8080",
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
});
|