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 fetch KV data and use is components server side #2

Open
vishvendrasingh opened this issue Jun 12, 2021 · 2 comments
Open

How fetch KV data and use is components server side #2

vishvendrasingh opened this issue Jun 12, 2021 · 2 comments

Comments

@vishvendrasingh
Copy link

I am not able to find out how can I fetch KV data on server side only with await and use in all components. Please help

@frandiox
Copy link
Owner

What do you mean with "use in all components"?

In production you should be able to use Cloudflare Workers KV normally like they mention in their docs. This won't work during development because it's a different environment, so you can try to wrap this logic in if (process.env.NODE_ENV === 'production') or something like that. I hope we can support KV in development some time soon.

@vishvendrasingh
Copy link
Author

I am naive to ssr, and I was trying to fetch KV and use in all components, But I can see that props can be used once only either in Default.vue or Index.vue. How can I fetch once and then get to use kv data in all componets. for example Lets suppose I fetch in modules then How can I access in Default.vue and index.vue. Thanks for the reply

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