diff --git a/src/EducationTrail/ClientApp/src/AppRoutes.tsx b/src/EducationTrail/ClientApp/src/AppRoutes.tsx
index eacd026..21c613d 100644
--- a/src/EducationTrail/ClientApp/src/AppRoutes.tsx
+++ b/src/EducationTrail/ClientApp/src/AppRoutes.tsx
@@ -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 = [
{
@@ -30,6 +30,10 @@ const AppRoutes = [
{
path: '/signup',
element:
+ },
+ {
+ path: '*',
+ element:
}
];
diff --git a/src/EducationTrail/ClientApp/src/layouts/HomeLayout.tsx b/src/EducationTrail/ClientApp/src/layouts/HomeLayout.tsx
index 8ca60ee..8b944b7 100644
--- a/src/EducationTrail/ClientApp/src/layouts/HomeLayout.tsx
+++ b/src/EducationTrail/ClientApp/src/layouts/HomeLayout.tsx
@@ -2,16 +2,18 @@ import React, { Component } from 'react';
import NavMenu from '@components/NavMenu';
import NavFooter from '@components/NavFooter'
-class HomeLayout extends Component {
+export interface LayoutProps {
+ children: React.ReactNode
+}
+
+class HomeLayout extends Component {
static displayName = HomeLayout.name;
render() {
return (
-
{this.props.children}
-
);
diff --git a/src/EducationTrail/ClientApp/src/layouts/Layout.tsx b/src/EducationTrail/ClientApp/src/layouts/Layout.tsx
index 1c461c0..4ac88e3 100644
--- a/src/EducationTrail/ClientApp/src/layouts/Layout.tsx
+++ b/src/EducationTrail/ClientApp/src/layouts/Layout.tsx
@@ -3,7 +3,11 @@ import NavMenu from '@components/NavMenu';
import NavFooter from '@components/NavFooter'
import '@assets/css/Layout.css'
-export class Layout extends Component {
+export interface LayoutProps {
+ children: React.ReactNode
+}
+
+export class Layout extends Component {
static displayName = Layout.name;
render() {
diff --git a/src/EducationTrail/ClientApp/src/layouts/LoginLayout.tsx b/src/EducationTrail/ClientApp/src/layouts/LoginLayout.tsx
index a4e38f6..b0a3fd9 100644
--- a/src/EducationTrail/ClientApp/src/layouts/LoginLayout.tsx
+++ b/src/EducationTrail/ClientApp/src/layouts/LoginLayout.tsx
@@ -1,6 +1,10 @@
import React, { Component } from 'react';
-export class Layout extends Component {
+export interface LayoutProps {
+ children: React.ReactNode
+}
+
+export class Layout extends Component {
static displayName = Layout.name;
render() {
diff --git a/src/EducationTrail/ClientApp/src/layouts/ProductLayout.tsx b/src/EducationTrail/ClientApp/src/layouts/ProductLayout.tsx
index fe2afdf..d05e48a 100644
--- a/src/EducationTrail/ClientApp/src/layouts/ProductLayout.tsx
+++ b/src/EducationTrail/ClientApp/src/layouts/ProductLayout.tsx
@@ -1,6 +1,10 @@
import React, { Component } from 'react';
-export class ProductLayout extends Component {
+export interface LayoutProps {
+ children: React.ReactNode
+}
+
+export class ProductLayout extends Component {
static displayName = ProductLayout.name;
render() {
diff --git a/src/EducationTrail/ClientApp/src/pages/404.tsx b/src/EducationTrail/ClientApp/src/pages/404.tsx
new file mode 100644
index 0000000..f81c16d
--- /dev/null
+++ b/src/EducationTrail/ClientApp/src/pages/404.tsx
@@ -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 (
+
+
+
+ );
+ }
+}
+
+export default NotFound;
diff --git a/src/EducationTrail/ClientApp/src/pages/counter.tsx b/src/EducationTrail/ClientApp/src/pages/counter.tsx
index 04085e8..5afaf1e 100644
--- a/src/EducationTrail/ClientApp/src/pages/counter.tsx
+++ b/src/EducationTrail/ClientApp/src/pages/counter.tsx
@@ -16,7 +16,7 @@ export class Counter extends Component<{}, CounterState> {
}
componentDidMount() {
- document.title = Counter.name + " - Education Trail";
+ document.title = "Counter - Education Trail";
}
incrementCounter() {
diff --git a/src/EducationTrail/ClientApp/src/pages/index.tsx b/src/EducationTrail/ClientApp/src/pages/index.tsx
index 05f60f4..d54698e 100644
--- a/src/EducationTrail/ClientApp/src/pages/index.tsx
+++ b/src/EducationTrail/ClientApp/src/pages/index.tsx
@@ -5,7 +5,7 @@ export class Home extends Component {
static displayName = Home.name;
componentDidMount() {
- document.title = Home.name + " - Education Trail";
+ document.title = "Home - Education Trail";
}
render() {
diff --git a/src/EducationTrail/ClientApp/src/pages/login.tsx b/src/EducationTrail/ClientApp/src/pages/login.tsx
index 7c33d37..b787a0e 100644
--- a/src/EducationTrail/ClientApp/src/pages/login.tsx
+++ b/src/EducationTrail/ClientApp/src/pages/login.tsx
@@ -4,7 +4,7 @@ export class Login extends Component {
static displayName = Login.name;
componentDidMount() {
- document.title = Login.name + " - Education Trail";
+ document.title = "Login - Education Trail";
}
render() {
diff --git a/src/EducationTrail/ClientApp/src/pages/signup.tsx b/src/EducationTrail/ClientApp/src/pages/signup.tsx
index 109afd4..965254d 100644
--- a/src/EducationTrail/ClientApp/src/pages/signup.tsx
+++ b/src/EducationTrail/ClientApp/src/pages/signup.tsx
@@ -4,7 +4,7 @@ export class Signup extends Component {
static displayName = Signup.name;
componentDidMount() {
- document.title = Signup.name + " - Education Trail";
+ document.title = "Signup - Education Trail";
}
render() {
diff --git a/src/EducationTrail/ClientApp/src/pages/test.tsx b/src/EducationTrail/ClientApp/src/pages/test.tsx
index ebe35bf..da11737 100644
--- a/src/EducationTrail/ClientApp/src/pages/test.tsx
+++ b/src/EducationTrail/ClientApp/src/pages/test.tsx
@@ -3,6 +3,10 @@ import React, { Component } from 'react';
class Test extends Component {
static displayName = Test.name;
+ componentDidMount() {
+ document.title = "Test - Education Trail";
+ }
+
render(): React.ReactNode {
return (
Welcome to Testing
diff --git a/src/EducationTrail/EducationTrail.csproj b/src/EducationTrail/EducationTrail.csproj
index ea3a53e..4f4c8df 100644
--- a/src/EducationTrail/EducationTrail.csproj
+++ b/src/EducationTrail/EducationTrail.csproj
@@ -54,5 +54,4 @@
-
\ No newline at end of file
diff --git a/src/EducationTrail/Program.cs b/src/EducationTrail/Program.cs
index dafde65..afbb21f 100644
--- a/src/EducationTrail/Program.cs
+++ b/src/EducationTrail/Program.cs
@@ -1,11 +1,13 @@
var builder = WebApplication.CreateBuilder(args);
-// Add services to the container.
-
builder.Services.AddControllers();
var app = builder.Build();
+app.UseStaticFiles();
+
+app.MapFallbackToFile("index.html");
+
app.UseHttpsRedirection();
app.UseAuthorization();
diff --git a/src/EducationTrail/Properties/launchSettings.json b/src/EducationTrail/Properties/launchSettings.json
index a961116..9c8326f 100644
--- a/src/EducationTrail/Properties/launchSettings.json
+++ b/src/EducationTrail/Properties/launchSettings.json
@@ -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"
@@ -26,4 +26,4 @@
}
}
}
-}
+}
\ No newline at end of file