From f21e40d8046ff1ba8b7352c9cf5b445334d7b7b9 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Mon, 4 Apr 2022 17:43:53 +0200 Subject: [PATCH] Add home route --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 2fa6528..cd10222 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use actix::Actor; use actix_identity::{CookieIdentityPolicy, IdentityService}; -use actix_web::{App, get, HttpServer, web}; +use actix_web::{App, get, HttpResponse, HttpServer, web}; use actix_web::cookie::SameSite; use actix_web::cookie::time::Duration; use actix_web::middleware::Logger; @@ -87,6 +87,10 @@ async fn main() -> std::io::Result<()> { .wrap(AuthMiddleware {}) .wrap(IdentityService::new(policy)) + // main route + .route("/", web::get() + .to(|| async { HttpResponse::Found().append_header(("Location", "/settings")).finish() })) + // health route .service(health)