Skip to content

Commit

Permalink
fix middleare
Browse files Browse the repository at this point in the history
  • Loading branch information
nksaraf committed Dec 30, 2023
1 parent f214d18 commit f4cd7c9
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/vinxi/lib/router-modes.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,24 +341,16 @@ const routerModes = {

viteDevServer.middlewares.stack.unshift({
route: "",
handle: (req, res, next) => {
handle: async (req, res, next) => {
// console.log(req.url, req.originalURL)
req.__preViteUrl = req.url;
req.url = joinURL(
app.config.server.baseURL ?? "",
router.base,
req.url,
);
next();
},
});

viteDevServer.middlewares.stack.push({
route: "",
handle: (req, res, next) => {
// console.log(req.url, req.originalURL)
await next();
req.url = req.__preViteUrl;
next();
},
});

Expand Down

0 comments on commit f4cd7c9

Please sign in to comment.