cryptgeon/backend/src/client.rs

15 lines
330 B
Rust
Raw Normal View History

2022-03-05 12:47:11 +01:00
use actix_files::{Files, NamedFile};
use actix_web::{web, Result};
2021-05-02 12:32:03 +02:00
pub fn init(cfg: &mut web::ServiceConfig) {
2022-03-01 00:53:47 +01:00
cfg.service(
Files::new("/", "./frontend/build")
.index_file("index.html")
.use_etag(true),
);
2021-05-02 12:32:03 +02:00
}
2022-03-05 12:47:11 +01:00
pub async fn index() -> Result<NamedFile> {
Ok(NamedFile::open("./frontend/build/index.html")?)
}