ui.rs 448 Bytes
use actix_web::Error;
use actix_files::NamedFile;
use anyhow::Result;

pub async fn frontend_js() -> Result<NamedFile, Error> {
    Ok( NamedFile::open("static/ui/artshop_frontend.js")?
      . set_content_type(mime::APPLICATION_JAVASCRIPT) )
}

pub async fn frontend_wasm() -> Result<NamedFile, Error> {
    Ok( NamedFile::open("static/ui/artshop_frontend_bg.wasm")?
      . set_content_type("application/wasm".parse::<mime::Mime>().unwrap()) )
}