| Crates.io | mogh_server |
| lib.rs | mogh_server |
| version | 1.3.0 |
| created_at | 2026-01-17 22:08:24.117809+00 |
| updated_at | 2026-01-25 20:26:02.658718+00 |
| description | Configurable axum server including TLS, Session, CORS, common security headers, and static file hosting. |
| homepage | |
| repository | https://github.com/moghtech/lib |
| max_upload_size | |
| id | 2051273 |
| size | 53,760 |
Configurable axum server including Session, CORS, common security headers, and static file hosting.
struct Config;
impl mogh_server::ServerConfig for Config {
fn port(&self) -> u16 {
3100
}
fn ssl_enabled(&self) -> bool {
true
}
fn ssl_key_file(&self) -> &str {
"./ssl/key.pem"
}
fn ssl_cert_file(&self) -> &str {
"./ssl/cert.pem"
}
}
let app = Router::new()
.route("/version", get(|| async { env!("CARGO_PKG_VERSION") }));
mogh_server::serve_app(
app,
Config,
).await?