other.rs 613 Bytes
use actix_web::{Error, http::StatusCode};
use anyhow::Result;

pub async fn root() -> Result<actix_files::NamedFile, Error> {
    Ok(actix_files::NamedFile::open("static/index.html")?)
}

pub async fn apidoc() -> Result<actix_files::NamedFile, Error> {
    Ok(actix_files::NamedFile::open("static/api.html")?)
}

pub async fn p404() -> Result<actix_files::NamedFile, Error> {
    Ok( actix_files::NamedFile::open("static/404.html")?
      . set_status_code(StatusCode::NOT_FOUND) )
}

pub async fn favicon() -> Result<actix_files::NamedFile, Error> {
    Ok(actix_files::NamedFile::open("static/favicon.ico")?)
}