cryptgeon/backend/src/client.rs

11 lines
293 B
Rust
Raw Normal View History

2021-05-02 12:32:03 +02:00
use actix_files::{Files, NamedFile};
use actix_web::{web, Responder};
pub fn init(cfg: &mut web::ServiceConfig) {
2022-01-02 23:46:08 +01:00
cfg.service(Files::new("/", "./frontend/build").index_file("index.html"));
2021-05-02 12:32:03 +02:00
}
pub async fn fallback_fn() -> impl Responder {
2022-01-02 23:46:08 +01:00
NamedFile::open("./frontend/build/index.html")
2021-05-02 12:32:03 +02:00
}