use simple styling

This commit is contained in:
Sebastian Hugentobler 2023-11-18 09:50:50 +01:00
parent 0f3fb34d85
commit a94d23bc2c
Signed by: shu
GPG key ID: BB32CF3CA052C2F0
6 changed files with 55 additions and 8 deletions

12
src/css_handler.rs Normal file
View file

@ -0,0 +1,12 @@
use axum::http::StatusCode;
use axum::{http::Response, response::IntoResponse};
static STYLESHEET: &str = include_str!("../static/styles.css");
pub async fn stylesheet_handler() -> Result<impl IntoResponse, StatusCode> {
let response = Response::builder()
.header("Content-Type", "text/css")
.body(STYLESHEET.to_string());
response.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)
}