[now-next] Add loading of custom routes (#3279)

This adds loading of `redirects` and `rewrites` from the `routes-manifest` in supported Next.js versions
This commit is contained in:
JJ Kasper
2019-11-09 23:17:58 -08:00
committed by Leo Lamprecht
parent a211c648ed
commit 5fc9b7d36d
8 changed files with 206 additions and 16 deletions

View File

@@ -89,7 +89,11 @@ async function testDeployment (
continue;
}
const probeUrl = `https://${deploymentUrl}${probe.path}`;
const fetchOpts = { method: probe.method, headers: { ...probe.headers } };
const fetchOpts = {
...probe.fetchOptions,
method: probe.method,
headers: { ...probe.headers },
};
if (probe.body) {
fetchOpts.headers['content-type'] = 'application/json';
fetchOpts.body = JSON.stringify(probe.body);