Skip to content

Can you use a pinia store from a Nuxt 3 server route? (defineEventHandler) #2466

Closed Answered by posva
jonesisg1 asked this question in Help and Questions
Discussion options

You must be logged in to vote

You can't but you also shouldn't need it. Server Routes are for API requests, they happen without the Nuxt (and vue) application running, so there isn't pinia, vue-router or anything like that.
Instead, call the API from the store if you want and update the values in your store as a result of the API call

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jonesisg1
Comment options

Answer selected by jonesisg1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants