From 218c01a1a12bcee953dd5d7f1d3e44da3b335343 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 14 Apr 2023 18:03:30 +0200 Subject: [PATCH] add gaming endpoint --- src/main.rs | 5 ++++- src/routes/gaming.rs | 7 +++++++ src/routes/mod.rs | 1 + templates/web3.html | 18 +++++++++--------- 4 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 src/routes/gaming.rs diff --git a/src/main.rs b/src/main.rs index ba4569a..2601a42 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,9 @@ use actix_files::Files; use actix_web::{middleware::DefaultHeaders, web, App, HttpServer}; use std::io::Result; -use crate::routes::{agreements, blog, contrib, index, networks, not_found, portfolio, web3}; +use crate::routes::{ + agreements, blog, contrib, gaming, index, networks, not_found, portfolio, web3, +}; mod config; mod template; @@ -41,6 +43,7 @@ async fn main() -> Result<()> { .service(blog::index) .service(blog::page) .service(web3::page) + .service(gaming::page) .service(Files::new("/", config.static_location.clone())) .default_service(web::to(not_found::page)) }) diff --git a/src/routes/gaming.rs b/src/routes/gaming.rs new file mode 100644 index 0000000..5885bcc --- /dev/null +++ b/src/routes/gaming.rs @@ -0,0 +1,7 @@ +use actix_web::{get, Responder}; + +#[get("/gaming")] +pub async fn page() -> impl Responder { + // TODO + actix_web::web::Redirect::to("/") +} diff --git a/src/routes/mod.rs b/src/routes/mod.rs index dcf465b..86684db 100644 --- a/src/routes/mod.rs +++ b/src/routes/mod.rs @@ -1,6 +1,7 @@ pub mod agreements; pub mod blog; pub mod contrib; +pub mod gaming; pub mod index; pub mod networks; pub mod not_found; diff --git a/templates/web3.html b/templates/web3.html index 51af992..4141006 100644 --- a/templates/web3.html +++ b/templates/web3.html @@ -77,7 +77,7 @@ /> - + this website sucks - - gamers - + + gamers +