handle non-Sapper responses when exporting - fixes #392

This commit is contained in:
Rich Harris
2018-08-30 18:22:40 -04:00
parent 1e22031765
commit 65d0172abe
6 changed files with 42 additions and 52 deletions

View File

@@ -108,6 +108,13 @@ const middlewares = [
}),
];
app.get(`${BASEPATH}/non-sapper-redirect-from`, (req, res) => {
res.writeHead(301, {
Location: `${BASEPATH}/non-sapper-redirect-to`
});
res.end();
});
if (BASEPATH) {
app.use(BASEPATH, ...middlewares);
} else {