diff --git a/.gitignore b/.gitignore index 17a9833101382973752c17b22a6fb6cec9ca75da..b0b76d98da60c6d4518fd5dd1d5bb5d81a5a340d 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ coverage /cypress/screenshots/ # Editor directories and files -ProxyAPI-UI/.vscode/extensions.json +.vscode/extensions.json !.vscode/extensions.json .idea *.suo @@ -26,3 +26,4 @@ ProxyAPI-UI/.vscode/extensions.json *.njsproj *.sln *.sw? +.env diff --git a/Dockerfile b/Dockerfile index d298d746c6493a996a8dd63274ad4846f2cd2553..a32d8d61f4c7cad7b5ed2720d1b2b2d2805b13a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,5 +11,6 @@ RUN npm run build-only # production stage FROM nginx:stable-alpine as production-stage COPY --from=build-stage /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000000000000000000000000000000000000..1424297eef187edb0899678349378b38859a80d3 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,19 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} diff --git a/src/components/SidebarLeft.vue b/src/components/SidebarLeft.vue index 677c417e8f4b40c0bbcb034854ab259e15c2560a..b80c53299fcac0d61044ea7b6bbe7e0afd48fbbc 100644 --- a/src/components/SidebarLeft.vue +++ b/src/components/SidebarLeft.vue @@ -34,5 +34,4 @@ </div> </template> -<style scoped> -</style> +<style scoped></style> diff --git a/src/router/index.ts b/src/router/index.ts index 6034817887ef91bc8e17408158b5e7832621f30e..09d4edee3d6a35a28e3b3eab6ad91bec8eb2c373 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -35,6 +35,10 @@ const router = createRouter({ path: "/", redirect: { name: "buckets" }, }, + { + path: "/:pathMatch(.*)", + component: () => import("../views/NotFoundView.vue"), + }, ], }); diff --git a/src/views/NotFoundView.vue b/src/views/NotFoundView.vue new file mode 100644 index 0000000000000000000000000000000000000000..51fd974e003e61c5d42fdb71ba6814d2b12994f0 --- /dev/null +++ b/src/views/NotFoundView.vue @@ -0,0 +1,14 @@ +<script setup lang="ts"></script> + +<template> + <div + class="container p-3 top-50 left-50 translate-middle position-fixed text-center" + > + <span class="fs-1 mb-5">Page Not Found</span><br /> + <span class="fs-3" + >Back to the <router-link to="/">HomePage</router-link></span + > + </div> +</template> + +<style scoped></style>