How could I access the request URL in a composable? #2238
Closed
martinszeltins
started this conversation in
General
Replies: 2 comments
-
Maybe the |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ahh, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I need to know the request URL in a composable with SSR. Since window object is not available in SSR mode, is there a way I could get access to the request URL in my component or composable? I believe Nuxt nitro server should have access to the request when it is rendering the components on the server, right?
Basically, the reason I need this is so that I could change the API endpoint based on if the user is using
localhost
orhttps://....
- but how do I get access to this?Beta Was this translation helpful? Give feedback.
All reactions