Skip to content

Commit

Permalink
Merge pull request #172 from crux-bphc/fix-nginx-misconfiguration
Browse files Browse the repository at this point in the history
Fix NGINX misconfiguration and 404 route to frontend
  • Loading branch information
soumitradev authored Feb 10, 2024
2 parents 37d639f + e83ba90 commit 2669061
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion frontend/docker/prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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;"]
12 changes: 12 additions & 0 deletions frontend/src/NotFound.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Route } from "@tanstack/react-router";
import { rootRoute } from "./main";

const notFoundRoute = new Route({
getParentRoute: () => rootRoute,
path: "404",
component: () => {
return <span>404: Not Found</span>;
},
});

export default notFoundRoute;
2 changes: 2 additions & 0 deletions frontend/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -62,6 +63,7 @@ export const router = new Router({
context: {
queryClient,
},
notFoundRoute: notFoundRoute,
});

// Register things for typesafety
Expand Down

0 comments on commit 2669061

Please sign in to comment.