RouteRules Exception for route path
Hi!
I have a routeRule for my API like that:
Now I'm experiencing the issue that some nuxt modules use the path for themselves
How can I add an exception to the API route for a certain route?
2 Replies
You’ll want to proxy your api and disable proxy for said module endpoints, e.g.
IIRC there was a bug in nitro when doing this. I haven’t tested to see if this is still the case.
Failing the above, I would suggest renaming your api endpoint in your application to avoid the conflicts, for example:
If neither of these are desirable, you can take the cumbersome route of configuring custom endpoints for each of the modules that use the api prefix. For example, with Nuxt icon you’d add the following in the config:
And so on…
Hey! Thanks for your reply, coincidentally I'm facing the issue with nuxt icon, but also did with nuxt content before
the solution with "localApiEndpoint" works well, however I'd prefer the first solution. I can't set the "proxy" property to false though, I'm getting a type error.
is this for a specific version maybe or has it been changed?