woutercouvaras
Dynamic hostname / Nitro
In case this helps anyone else, I've ended up dropping the
@nuxtjs/sitemap
module in favour of simply creating my own api endpoint, and using this nodejs sitemap package to return the xml formatted doc: https://www.npmjs.com/package/sitemap3 replies
Dynamic hostname / Nitro
Is there no one else solving problems like this? I've got one project that serves 12 sites and another project that serves 2.
Today, I tried setting a custom header in my api middleware (I can see the correct host there), but my custom header still ends up beging set to
localhost
when I access it in the /api/__sitemap__/urls.ts
file.
If I can't solve this I might have to build my own solution 😦3 replies
Nuxt Layers
Sounds very plausible for custom classes/styles, but the styles I'm using are standard tailwind styles (in this case). If you're also experiencing this issue, perhaps it's indicative of a bigger problem?
It's just super weird, seeing as atinux's example just works. Hmm...I just had a thought to check the nuxt versions. Atinux's example uses 3.2.2, I'm currently on 3.2.0. I'll upgrade and try again, but I don't hold out too much hope.
It's just super weird, seeing as atinux's example just works. Hmm...I just had a thought to check the nuxt versions. Atinux's example uses 3.2.2, I'm currently on 3.2.0. I'll upgrade and try again, but I don't hold out too much hope.
14 replies
Fetching related data sequentially
The direction I've been leaning in is to create a composable that takes an array of urls. In the composable, you make all your requests with an
await Promise.all
. You can expose similar statuses to the useFetch compsable (e.g. pending, error, data). Data can then contain an object of all your records - e.g. { posts: [...], authors: [...], comments: [...]}13 replies