Skip to content

Commit 762d7e7

Browse files
committed
Fix home route on server
1 parent 2ca544e commit 762d7e7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

data-browser/src/routes/Routes.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ import { paths } from './paths';
1616
import ResourcePage from '../views/ResourcePage';
1717
import { ShareRoute } from './ShareRoute';
1818

19+
function removeTrailingSlash(str) {
20+
return str.replace(/\/+$/, '');
21+
}
22+
1923
/**
2024
* Handles the browser URL navigation paths. Some rules:
2125
*
@@ -38,7 +42,9 @@ export function AppRoutes(): JSX.Element {
3842
<Route path={paths.search} element={<Search />} />
3943
<Route
4044
path='/'
41-
element={<ResourcePage subject={window.location.href} />}
45+
element={
46+
<ResourcePage subject={removeTrailingSlash(window.location.href)} />
47+
}
4248
/>
4349
<Route path='*' element={<Local />} />
4450
</Routes>

0 commit comments

Comments
 (0)