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

Get Cookies Headers during vitedge initializatio script #91

Closed
oleghalin opened this issue Jul 8, 2022 · 4 comments · Fixed by #92
Closed

Get Cookies Headers during vitedge initializatio script #91

oleghalin opened this issue Jul 8, 2022 · 4 comments · Fixed by #92

Comments

@oleghalin
Copy link
Contributor

Hello. I'm trying to set i18n locale on the server-side, to do so I need to get the locale cookie from Request Headers. How can i access it in vitedge callback?

image

@frandiox
Copy link
Owner

Hi! You should be able to get the request object in the main hook: export default vitedge(App, {...}, (context) => { context.request; ... });

@oleghalin
Copy link
Contributor Author

image

@oleghalin
Copy link
Contributor Author

And console displays undefined

@oleghalin
Copy link
Contributor Author

oleghalin commented Jul 11, 2022

image

And looks like types doesn't have it too.

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

Successfully merging a pull request may close this issue.

2 participants