Following the examples from the docs to do a 301 redirect, redirect is not preserving the path / url object not available

Following this in a new app,

  .match({ headers: { host: /^(?!www\.)$/ } }, ({ redirect, send }) => {
    send('', 301)

The url object is not available in the router, the redirect has the following:

Is there something I need to do to access the url in my router? My assumption is it would be global based on this

I think you want this instead:


Note the single quotes, not backticks. We’re not dereferencing url at runtime in serverless, but rather at the edge.

Yep, that was it. Thanks!