Ken
Ken
NNuxt
Created by Ken on 4/25/2025 in #❓・help
How to deploy a static nuxt app
@kapa.ai
export default defineNuxtConfig({
compatibilityDate: '2024-11-01',
devtools: { enabled: true },
ssr: true, // Static generation still uses SSR at build time

app: {
baseURL: '/site', // Prefix all routes and assets with /site/
},

nitro: {
preset: 'static', // Use static site generation
output: {
publicDir: '../dist', // Output directory for static files
},
},

modules: ['@nuxt/ui', '@nuxt/icon'],
})
export default defineNuxtConfig({
compatibilityDate: '2024-11-01',
devtools: { enabled: true },
ssr: true, // Static generation still uses SSR at build time

app: {
baseURL: '/site', // Prefix all routes and assets with /site/
},

nitro: {
preset: 'static', // Use static site generation
output: {
publicDir: '../dist', // Output directory for static files
},
},

modules: ['@nuxt/ui', '@nuxt/icon'],
})
Still having issues where my nginx and fastapi isnt able to serve nuxt3app and I when I access the site, I keep getting `{'detail': "Not found'} API/Backend/main.py
app.mount("/site", StaticFiles(directory="../dist", html=True), name="frontend")
app.mount("/site", StaticFiles(directory="../dist", html=True), name="frontend")
18 replies
NNuxt
Created by Ken on 4/25/2025 in #❓・help
How to deploy a static nuxt app
@kapa.ai can you write me a new nuxt cnfig file?
18 replies
NNuxt
Created by Ken on 4/25/2025 in #❓・help
How to deploy a static nuxt app
@kapa.ai
18 replies
NNuxt
Created by Ken on 4/25/2025 in #❓・help
How to deploy a static nuxt app
so I have my project setup like this: API/Backend - FastAPI app API/frontend - Nuxt3 app API/dist - frontend build output for static
18 replies