import { type ProxyOptions } from "https://dotland.deno.dev/x/oak@v12.2.0/middleware/proxy.ts";
Type Parameters
Properties
The fetch function to use to proxy the request. This defaults to the
global fetch
function. This is designed for test mocking purposes.
Additional headers that should be set in the response. The value can be a headers init value or a function that returns or resolves with a headers init value.
Either a record or a proxy map function that will allow proxied requests being handled by the middleware to be remapped to a different remote path.
A string, regular expression or proxy match function what determines if the proxy middleware should proxy the request.
If the value is a string the match will be true if the requests pathname starts with the string. In the case of a regular expression, if the pathname
Methods
A callback hook that is called after the response is received which allows the response content type to be adjusted. This is for situations where the content type provided by the proxy server might not be suitable for responding with.