Closed Cheaterman closed 3 months ago
I don't think we should change the default, as the module does assume you have a Nuxt backend. In your case where you configure your custom backend, the module does offer you the option to configure it, as you already pointed out. I am not sure if we need to do anything here, consider your cases are also a bit specific.
I do think considering /api/
namespace available is still a fairly bold assumption to make, even when someone is using a Nuxt backend ; people will usually want it for their own apps? As in, I don't agree that it's "a bit specific" to consider it unavailable.
Besides, I don't think it breaks anything to change the current default, while keeping it as-is evidently does break some setups, so I'm not sure what's the holdup here?
/api/
is the default convention Nuxt has. Whatever the name we choose, there is a chance to "clash" if you want to say it strictly. Instead of a random name like /_
prefixed, I'd prefer to follow Nuxt's default convention. It's not hard-coded, and you can change it to whatever makes sense to you.
Thanks for bringing this up.
The
/api/*
prefix is common enough that some people will want to use it for their own purposes, breaking NuxtIcon.โ Type of change
๐ Description
Here I use the following code in my
nuxt.config.ts
which allows SSR to communicate with my (non-Nuxt) backend :Which breaks recent versions of NuxtIcon because it (boldly) assumes
/api
is available. This PR fixes that.EDIT: I currently fix this by adding
to my
nuxt.config.ts
but I assume it shouldn't be necessary.