| Crates.io | caslex |
| lib.rs | caslex |
| version | 0.2.7 |
| created_at | 2025-03-29 17:37:23.089066+00 |
| updated_at | 2025-09-05 17:38:07.582069+00 |
| description | Tools for creating web services |
| homepage | https://github.com/mkbeh/caslex |
| repository | https://github.com/mkbeh/caslex |
| max_upload_size | |
| id | 1611474 |
| size | 96,750 |
caslex is a set of tools for creating web services.
More information about this crate can be found in the crate documentation.
use caslex::server::{Config, Server};
use utoipa_axum::{router::OpenApiRouter, routes};
#[utoipa::path(
get,
path = "/",
responses(
(status = 200, description = "Ok")
)
)]
async fn handler() -> &'static str {
"Hello, World!"
}
#[tokio::main]
async fn main() {
let config = Config::parse();
let router = OpenApiRouter::new().routes(routes!(handler));
let result = Server::new(config).router(router).run().await;
match result {
Ok(_) => std::process::exit(0),
Err(_) => {
std::process::exit(1);
}
}
}
You can find this example as well as other example projects in the example directory.
See the crate documentation for way more examples.
This crate uses #![forbid(unsafe_code)] to ensure everything is implemented in 100% safe Rust.
The examples folder contains various examples of how to use axum. The docs also provide lots of code snippets and examples.
List of projects using caslex:
This project is licensed under the MIT license.