Skip to content

Commit

Permalink
feat(paths): Redirect /app to /app/ (#62)
Browse files Browse the repository at this point in the history
* feat(paths): Redirect /app to /app/

* fix(paths): using pathname instead of href in redirect condition

---------

Co-authored-by: LUC BILLAUD <[email protected]>
  • Loading branch information
Billuc and LUC BILLAUD authored Jul 16, 2024
1 parent 8db014f commit da644e2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ dist-ssr
*.local
.vscode/
*~
build
4 changes: 3 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ Authors
Place de l'Universite 1
1348 Ottignies-Louvain-la-Neuve
Belgium
https://uclouvain.be/icteam
https://uclouvain.be/icteam

* Luc Billaud <[email protected]>
11 changes: 11 additions & 0 deletions WebApplication/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Orthanc Explorer 2</title>
<script>
// Custom bit of code to redirect to /app/ if the uri is /app
// The reason for this is that the path to assets is relative
// so it won't work for /app but it will for /app/
const currentUri = new URL(window.location.href);

if (currentUri.pathname.endsWith("app")) {
currentUri.pathname += "/";
window.location.href = currentUri.toString();
}
</script>
</head>
<body>
<div id="app"></div>
Expand Down

0 comments on commit da644e2

Please sign in to comment.