mirror of
https://github.com/redlib-org/redlib.git
synced 2025-05-04 20:30:37 +00:00
Use std::fs over actix-files
This commit is contained in:
parent
4f379754f7
commit
f455e2095d
8 changed files with 11 additions and 74 deletions
10
src/main.rs
10
src/main.rs
|
@ -1,6 +1,6 @@
|
|||
// Import Crates
|
||||
use actix_files::NamedFile;
|
||||
use actix_web::{get, App, HttpResponse, HttpServer, Result};
|
||||
use actix_web::{get, App, HttpResponse, HttpServer};
|
||||
use std::fs;
|
||||
|
||||
// Reference local files
|
||||
mod popular;
|
||||
|
@ -10,9 +10,9 @@ mod user;
|
|||
|
||||
// Create Services
|
||||
#[get("/style.css")]
|
||||
async fn style() -> Result<NamedFile> {
|
||||
let file = NamedFile::open("static/style.css");
|
||||
Ok(file?)
|
||||
async fn style() -> HttpResponse {
|
||||
let file = fs::read_to_string("static/style.css").expect("ERROR: Could not read style.css");
|
||||
HttpResponse::Ok().body(file)
|
||||
}
|
||||
|
||||
#[get("/favicon.ico")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue