1 unstable release
0.1.0 | Feb 5, 2024 |
---|
#820 in #web-framework
25 downloads per month
Used in 2 crates
16KB
297 lines
MinCat
mincat is a fast and compact server-side framework
use mincat::http::{get, Router};
#[tokio::main]
async fn main() {
let router = Router::new().route(hello);
mincat::router(router).run("127.0.0.1:3000").await;
}
#[get("/hello")]
async fn hello() -> &'static str {
"hello word"
}
English · 简体中文
Install
cargo add mincat
Examples
- Basic Hello World
- How to Limit Body Size
- How to Use Cookies
- How to Set Up Cross-Origin Resource Sharing (CORS)
- How to Customize Errors
- How to Customize Extractors for Parameters
- How to Customize Responses
- How to Extract FormData
- How to Extract FormUrlencoded Data
- How to Use Logging
- How to Extract JSON
- How to Customize Middleware
- How to Extract URL Path Parameters
- How to Extract URL Query Parameters
- How to Redirect
- How to Use Routing
- How to Use Sessions
- How to Use Server-Sent Events (SSE)
- How to Use Global State
- How to Proxy Static Folders
- How to Upload Files
- How to Use WebSockets
Dependencies
~215–650KB
~16K SLoC