MinecraftStorage
MinecraftStorage
NNuxt
Created by MinecraftStorage on 10/18/2024 in #❓・help
Can you deploy Nuxt as SSR on Cloudflare pages?
I tried deploying Nuxt on Cloudflare, but the SSR seems not to work. UseFetch doesn't work on the server, but only on client. So the question is, does Cloudflare support ssr or is it only for client side apps?
15 replies
NNuxt
Created by MinecraftStorage on 6/28/2024 in #❓・help
How to assign a middleware to custom routes?
So for file-system based routing you assign middleware to individual pages or a parent page through definePageMeta utility function. But, as definePageMeta is ignored in custom routing, how do you assign a middleware in this case. I have gone through the documentation but couldn't find any clean solutions. I think you should be able to assign middleware to routes in router.options.js file like this:
{
path: "account",
name: "account",
middleware: "auth",
component: account
}
{
path: "account",
name: "account",
middleware: "auth",
component: account
}
But this doesn't work. Do you have any better solution for this?
6 replies
NNuxt
Created by MinecraftStorage on 6/27/2024 in #❓・help
How are you resolving routes while using I18n module?
Previously, I obtained route paths by passing an object with route name and parameters to NuxtLink, which worked perfectly. However, once I introduced the I18n module, all my route names have been prefixed with locale names (loginen, logines, etc.). This now makes it problematic to obtain routes as now I need to pass the current locale alongside with the route name. This makes the code unreadable and adds extra hassle to the development. Do you have any better solution for obtaining route paths?
6 replies