You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The URL object is used for rewrites. For example, if you want to rewrite <username>.site.dev to www.side.dev/profile/<username>, they suggest using an edge function like this:
@Youhan What are you trying to accomplish here? Nitro on Netlify will automatically turn configured redirects and rewrites into a configuration that Netlify understands, so they should work. Are you trying to return redirects/rewrites dynamically that can only be determined dynamically at runtime, hence needing to return a URL?
You can directly use event.url instead of getRequestURL(event)
I made a feature request to investigate possibility of supporting return <URL> as redirect you can follow from here: Support URL as response unjs/h3#913
Describe the feature
I was not sure if this goes to H3 or Nitro. Apologies if I am confused.
As per Netlify Edge functions documentation, the function can return a standard Response object or a URL object.
link: https://docs.netlify.com/edge-functions/api/#overview
The URL object is used for rewrites. For example, if you want to rewrite
<username>.site.dev
towww.side.dev/profile/<username>
, they suggest using an edge function like this:This function does not return a Response object, instead it returns a URL object. How that would be possible with Nitro/H3?
Here are links to Netlify example and docs:
Additional information
The text was updated successfully, but these errors were encountered: