Skip to content

Commit

Permalink
Fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
cofob committed May 14, 2024
1 parent 9d22266 commit b0d5398
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 20 deletions.
16 changes: 0 additions & 16 deletions src/routes/index.rs

This file was deleted.

5 changes: 1 addition & 4 deletions src/routes/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
mod index;
mod redirect;

use actix_web::{web, Scope};

use crate::config::AppConfig;

pub fn main_scope(config: &AppConfig) -> Scope {
web::scope("")
.service(index::scope(config))
.service(redirect::scope(config))
web::scope("").service(redirect::scope(config))
}
6 changes: 6 additions & 0 deletions src/routes/redirect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use crate::{

pub fn scope(_config: &AppConfig) -> Scope {
web::scope("")
.service(index)
.service(history_redirect)
.service(cached_redirect)
.service(base_redirect)
Expand All @@ -38,6 +39,11 @@ impl_api_error!(RedirectError,
}
);

#[get("/")]
async fn index() -> actix_web::Result<impl Responder> {
Ok(Redirect::to("https://github.com/cofob/fastside").permanent())
}

#[derive(Template)]
#[template(path = "cached_redirect.html", escape = "none")]
pub struct CachedRedirectTemplate {
Expand Down

0 comments on commit b0d5398

Please sign in to comment.