From 6cf75daea9905dc266704e8c1d658cf4d87377b5 Mon Sep 17 00:00:00 2001 From: somebody1234 Date: Mon, 13 Nov 2023 19:09:01 +1000 Subject: [PATCH] Add 404.html for static hosting (#8276) Adds a `404.html` to allow client-side routing to work when using static hosting. # Important Notes - The routing uses the existing logic to infer the base path. This means that if the user accesses an invalid path, the invalid path will be used as the base path. --- app/ide-desktop/lib/content/src/index.html | 5 ----- app/ide-desktop/lib/dashboard/bundle.ts | 1 + app/ide-desktop/lib/dashboard/src/404.html | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) create mode 120000 app/ide-desktop/lib/dashboard/src/404.html diff --git a/app/ide-desktop/lib/content/src/index.html b/app/ide-desktop/lib/content/src/index.html index 212003adaf..edee86ef35 100644 --- a/app/ide-desktop/lib/content/src/index.html +++ b/app/ide-desktop/lib/content/src/index.html @@ -39,11 +39,6 @@ -
diff --git a/app/ide-desktop/lib/dashboard/bundle.ts b/app/ide-desktop/lib/dashboard/bundle.ts index 3666b18123..4bb0a22a34 100644 --- a/app/ide-desktop/lib/dashboard/bundle.ts +++ b/app/ide-desktop/lib/dashboard/bundle.ts @@ -32,6 +32,7 @@ async function bundle() { }) opts.entryPoints.push( path.resolve(THIS_PATH, 'src', 'index.html'), + path.resolve(THIS_PATH, 'src', '404.html'), path.resolve(THIS_PATH, 'src', 'index.ts') ) opts.metafile = ANALYZE diff --git a/app/ide-desktop/lib/dashboard/src/404.html b/app/ide-desktop/lib/dashboard/src/404.html new file mode 120000 index 0000000000..64233a9e95 --- /dev/null +++ b/app/ide-desktop/lib/dashboard/src/404.html @@ -0,0 +1 @@ +index.html \ No newline at end of file