feat: make index api route redirect to home page
parent
ad92655eab
commit
38751f3e1e
@ -1,11 +1,10 @@
|
|||||||
use rapid_web::actix::HttpResponse;
|
use rapid_web::actix::web::Redirect;
|
||||||
use rapid_web::{ rapid_web_codegen::rapid_handler, welcome_view };
|
use rapid_web::actix::Responder;
|
||||||
|
use rapid_web::rapid_web_codegen::rapid_handler;
|
||||||
|
|
||||||
pub const ROUTE_KEY: &str = "index";
|
pub const ROUTE_KEY: &str = "index";
|
||||||
|
|
||||||
#[rapid_handler]
|
#[rapid_handler]
|
||||||
pub async fn query() -> HttpResponse {
|
pub async fn query() -> impl Responder {
|
||||||
HttpResponse::Ok()
|
Redirect::to("http://localhost:3000/").permanent()
|
||||||
.content_type("text/html; charset=utf-8")
|
|
||||||
.body(welcome_view)
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue