Skip to content

Commit

Permalink
Added regex to convert backslash to forwardslash in routes
Browse files Browse the repository at this point in the history
  • Loading branch information
colecrouter committed Jan 27, 2022
1 parent 53c6318 commit fd42fd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/wrangler/pages/functions/filepath-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export async function generateConfigFromFileTree({
routePath = "";
}

routePath = `${baseURL}/${routePath}`;
routePath = `${baseURL}/${routePath}`.replace(/\\/g, "/");

routePath = routePath.replace(/\[\[(.+)]]/g, ":$1*"); // transform [[id]] => :id*
routePath = routePath.replace(/\[(.+)]/g, ":$1"); // transform [id] => :id
Expand Down

0 comments on commit fd42fd4

Please sign in to comment.