// The public site. Pages render on request from the content service's // published notes, so a saved note is live within a minute without a rebuild. import node from "@astrojs/node"; import { defineConfig } from "astro/config"; export default defineConfig({ site: "https://gregkilmer.com", output: "server", adapter: node({ mode: "standalone" }), trailingSlash: "never", build: { format: "file", assets: "assets" }, devToolbar: { enabled: false }, // Behind Nginx Proxy Manager the request arrives over plain http. Trusting // X-Forwarded-Host/Proto for these hosts only lets the form posts pass // Astro's same-origin check without trusting any other host a client sends. security: { allowedDomains: [ { hostname: "gregkilmer.com", protocol: "https" }, { hostname: "*.gregkilmer.com", protocol: "https" }, ], }, server: { host: true, port: Number(process.env.PORT ?? 4330) }, vite: { // cookie is bundled so the server never picks up express's older copy hoisted to the root. ssr: { noExternal: ["@gk/ui", "cookie"] }, // See packages/ui/astro.config.mjs: astro needs its own cookie, not express's. environments: { prerender: { resolve: { noExternal: ["cookie"] } } }, }, });