Skip to content

Commit

Permalink
Add index page redirect to github
Browse files Browse the repository at this point in the history
  • Loading branch information
cofob committed May 14, 2024
1 parent 90d0a0a commit 9d22266
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/routes/index.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use actix_web::{
get,
web::{self, Redirect},
Responder, Scope,
};

use crate::config::AppConfig;

pub fn scope(_config: &AppConfig) -> Scope {
web::scope("").service(index)
}

#[get("/")]
async fn index() -> actix_web::Result<impl Responder> {
Ok(Redirect::to("https://github.com/cofob/fastside").permanent())
}
5 changes: 4 additions & 1 deletion src/routes/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
mod index;
mod redirect;

use actix_web::{web, Scope};

use crate::config::AppConfig;

pub fn main_scope(config: &AppConfig) -> Scope {
web::scope("").service(redirect::scope(config))
web::scope("")
.service(index::scope(config))
.service(redirect::scope(config))
}

0 comments on commit 9d22266

Please sign in to comment.