diff --git a/frontend/docker/prod/Dockerfile b/frontend/docker/prod/Dockerfile index 3e87c1f4..c3f2b488 100644 --- a/frontend/docker/prod/Dockerfile +++ b/frontend/docker/prod/Dockerfile @@ -53,6 +53,5 @@ RUN rm -rf ./* COPY nginx.prod.conf /etc/nginx/nginx.conf COPY --from=build-stage /usr/src/app/frontend/dist . -COPY --from=build-stage /usr/src/app/frontend/.env . CMD ["nginx", "-g", "daemon off;"] diff --git a/frontend/src/NotFound.tsx b/frontend/src/NotFound.tsx new file mode 100644 index 00000000..8d8675ae --- /dev/null +++ b/frontend/src/NotFound.tsx @@ -0,0 +1,12 @@ +import { Route } from "@tanstack/react-router"; +import { rootRoute } from "./main"; + +const notFoundRoute = new Route({ + getParentRoute: () => rootRoute, + path: "404", + component: () => { + return 404: Not Found; + }, +}); + +export default notFoundRoute; diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index c7b5f991..74c2a49f 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -19,6 +19,7 @@ import finalizeTimetableRoute from "./Finalize"; import getDegreesRoute from "./GetDegrees"; import indexRoute from "./Home"; import loginRoute from "./Login"; +import notFoundRoute from "./NotFound"; import RootComponent from "./RootComponent"; import viewTimetableRoute from "./ViewTimetable"; import "./index.css"; @@ -62,6 +63,7 @@ export const router = new Router({ context: { queryClient, }, + notFoundRoute: notFoundRoute, }); // Register things for typesafety