feat: make index api route redirect to home page

main
Carsten Kragelund 2023-08-02 19:59:56 +02:00
parent ad92655eab
commit 38751f3e1e
Signed by: nyx
GPG Key ID: CADDADEEC9F753C0
1 changed files with 5 additions and 6 deletions

@ -1,11 +1,10 @@
use rapid_web::actix::HttpResponse;
use rapid_web::{ rapid_web_codegen::rapid_handler, welcome_view };
use rapid_web::actix::web::Redirect;
use rapid_web::actix::Responder;
use rapid_web::rapid_web_codegen::rapid_handler;
pub const ROUTE_KEY: &str = "index";
#[rapid_handler]
pub async fn query() -> HttpResponse {
HttpResponse::Ok()
.content_type("text/html; charset=utf-8")
.body(welcome_view)
pub async fn query() -> impl Responder {
Redirect::to("http://localhost:3000/").permanent()
}