Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can we make a SSR call? #9

Closed
larsjanssen6 opened this issue Jul 19, 2024 · 1 comment
Closed

How can we make a SSR call? #9

larsjanssen6 opened this issue Jul 19, 2024 · 1 comment

Comments

@larsjanssen6
Copy link

larsjanssen6 commented Jul 19, 2024

Hi,

How can we make a SSR call?

When i try this:

const { workspaces: workspaceData } = await $fetch<any>("workspaces");

It's always client side. When I add ssr:

const { workspaces: workspaceData } = await $fetch<any>("workspaces", {
       server: true
});

https://nuxt.com/docs/getting-started/data-fetching

It's not working , and still making a client side call (I have SSR enabled in my nuxt.config file).

Thanks!

@k2so-dev
Copy link
Owner

Hi, you can see an example here https://github.com/k2so-dev/laravel-nuxt/blob/main/nuxt/app/pages/account/devices.vue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants