headplane/astro.config.mjs

57 lines
1.2 KiB
JavaScript
Raw Normal View History

import node from '@astrojs/node';
import tailwind from '@astrojs/tailwind';
import { defineConfig } from 'astro/config';
// Heady - Awesome VPN Management with Alpine.js/Astro 🤠
export default defineConfig({
output: 'hybrid', // Static pages with SSR endpoints
adapter: node({
mode: 'standalone',
}),
integrations: [
tailwind({
// Tailwind configuration
applyBaseStyles: false, // We'll handle base styles ourselves
}),
],
// Content collections for live VPN data are enabled by default in Astro 4.x
vite: {
define: {
global: 'globalThis',
},
optimizeDeps: {
include: ['alpinejs', 'guacamole-lite', 'chart.js'],
},
server: {
proxy: {
// Proxy API calls to Go backend during development
// Exclude auth endpoints to test our new OIDC system
'/api/(?!auth).*': {
target: 'http://localhost:3000',
changeOrigin: true,
},
// Proxy remote access calls to FastAPI
'/terminal': {
target: 'http://localhost:8000',
changeOrigin: true,
ws: true, // Enable WebSocket proxying
},
},
},
},
// Server configuration for production
server: {
port: 3001, // Different from Go backend
host: true,
},
// Build optimizations
build: {
assets: 'assets',
},
});