Skip to content

Commit 9767c0f

Browse files
path issues
1 parent 0262810 commit 9767c0f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

frontend/src/router/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ import WorkspaceView from '@/views/WorkspaceView.vue';
88
*/
99
function getBasePath(): string {
1010
const path = window.location.pathname;
11-
// Match paths ending with /dancer or /dancer/
12-
const match = path.match(/^(.*\/dancer)\/?/);
11+
// Match paths containing /dancer followed by end, slash, or more path
12+
const match = path.match(/^(.*\/dancer)(?:\/|$)/);
1313
if (match) {
1414
return match[1] + '/';
1515
}
1616
return '/';
1717
}
1818

19+
// Log base path for debugging (remove in production if needed)
20+
console.log('DCTap Dancer base path:', getBasePath(), 'from pathname:', window.location.pathname);
21+
1922
const routes: RouteRecordRaw[] = [
2023
{
2124
path: '/',

frontend/src/services/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import type {
1616
*/
1717
function getBasePath(): string {
1818
const path = window.location.pathname;
19-
// Match paths ending with /dancer or /dancer/
20-
const match = path.match(/^(.*\/dancer)\/?/);
19+
// Match paths containing /dancer followed by end, slash, or more path
20+
const match = path.match(/^(.*\/dancer)(?:\/|$)/);
2121
if (match) {
2222
return match[1] + '/';
2323
}

0 commit comments

Comments
 (0)