Additional headers to send upstream
The path for the URL to request from the upstream site. You can reference variables
captured by the route pattern using :variable
.
Example
new Router()
.get('/some/path/with/:variable', ({ proxy }) => {
proxy('legacy', { path: '/some/other/path/with/:variable' })
})
Path can also be a function that returns a URL path string, in which case it will be computed in the cloud rather than at build time.
Removes the "=" from search parameters that have no value. So for example: "http://domain.com?foo=&bar=" becomes "http://domain.com?foo&bar"
A function that transforms the request before it is sent to the upstream server. In general, this is used to alter the request headers or body based on some conditional logic. Note that code in this method will be executed at the serverless tier and not the edge.
A function that transforms the response before it is returned to the browser. This function
typically alters response.body
to change the content sent to the browser. It can also add, remove,
and alter response headers. Note that code in this method will be executed at the serverless tier
and not the edge.
Generated using TypeDoc
Options for the
proxy
method