De Bok
De Bok
SSolidJS
Created by De Bok on 3/5/2025 in #support
Middleware around API proxy
Hi all I have this in my app.config.json
export default defineConfig({
ssr: false,
server: {
routeRules: {
'/api/**': {
proxy: {
to: 'http://127.0.0.1:5000/**',
}
}
},
},
})
export default defineConfig({
ssr: false,
server: {
routeRules: {
'/api/**': {
proxy: {
to: 'http://127.0.0.1:5000/**',
}
}
},
},
})
I would like to add a middleware that runs for all the requests that I receive, including the requests that get proxied. I tried adding a normal solid js middleware using these instructions: https://docs.solidjs.com/solid-start/advanced/middleware However this middleware doesn't execute on proxied requests. I also tried adding a nitro middleware, but that doesn't execute at all. https://nitro.build/guide/routing#middleware Is there another way in which I can add a middleware that wraps everything?
34 replies