29 lines
590 B
Rust
29 lines
590 B
Rust
use axum::{
|
|
Router,
|
|
http::header,
|
|
response::{IntoResponse, Redirect, Response},
|
|
routing::get,
|
|
};
|
|
|
|
mod components;
|
|
mod icons;
|
|
mod pages;
|
|
|
|
pub const CSS: &str = include_str!(concat!(env!("OUT_DIR"), "/styles.css"));
|
|
|
|
pub fn web_router() -> Router {
|
|
Router::new()
|
|
.route(
|
|
"/styles.css",
|
|
get(([(header::CONTENT_TYPE, "text/css")], CSS)),
|
|
)
|
|
.merge(pages::pages())
|
|
}
|
|
|
|
pub struct RedirectViaError(Redirect);
|
|
impl IntoResponse for RedirectViaError {
|
|
fn into_response(self) -> Response {
|
|
self.0.into_response()
|
|
}
|
|
}
|