Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
chore(client): add routing for 404 error
Browse files Browse the repository at this point in the history
  • Loading branch information
wesdevpro committed Nov 27, 2023
1 parent 2867319 commit 8a19ecb
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/EducationTrail/ClientApp/src/AppRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Test from "@pages/test";
import Hub from "@pages/product/hub";
import Login from "@pages/login";
import Signup from "@pages/signup";

import NotFound from "@pages/404";

const AppRoutes = [
{
Expand All @@ -30,6 +30,10 @@ const AppRoutes = [
{
path: '/signup',
element: <Signup />
},
{
path: '*',
element: <NotFound/>
}
];

Expand Down
26 changes: 26 additions & 0 deletions src/EducationTrail/ClientApp/src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React, { Component } from "react";
import HomeLayout from "@layouts/HomeLayout";

export class NotFound extends Component {
static displayName = NotFound.name;

componentDidMount() {
document.title = "404 - Not Found";
}

render() {
return (
<HomeLayout>
<div className="hero min-h-screen bg-base-200">
<div className="hero-content text-center">
<div className="max-w-md">
<h1 className="text-6xl font-bold">404 Not Found</h1>
</div>
</div>
</div>
</HomeLayout>
);
}
}

export default NotFound;
8 changes: 4 additions & 4 deletions src/EducationTrail/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:48063",
"sslPort": 44347
"sslPort": 0
}
},
"profiles": {
"Vite_CSharp": {
"Company.WebApplication1": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
Expand All @@ -26,4 +26,4 @@
}
}
}
}
}

0 comments on commit 8a19ecb

Please sign in to comment.