Skip to content

Commit

Permalink
fix: Middleware loading on seprate domains
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien2p committed Feb 26, 2022
1 parent bed1668 commit ae4f660
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions src/loaders/admin-api.loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ export async function adminApiLoader(
.map((middleware) => ({
...middleware,
routes: middleware.routes.filter((route) => {
if (route.path.startsWith('/admin')) {
route.path = route.path.replace('/admin', '');
return true;
}
return false;
return route.path.startsWith('*') || route.path.startsWith('/admin');
}),
}))
.filter((middleware) => middleware.routes.length);
Expand Down
6 changes: 1 addition & 5 deletions src/loaders/store-api.loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ export async function storeApiLoader(
.map((middleware) => ({
...middleware,
routes: middleware.routes.filter((route) => {
if (route.path.startsWith('/store')) {
route.path = route.path.replace('/store', '');
return true;
}
return false;
return route.path.startsWith('*') || route.path.startsWith('/store');
}),
}))
.filter((middleware) => middleware.routes.length);
Expand Down

0 comments on commit ae4f660

Please sign in to comment.