1 unstable release

0.1.0 Feb 5, 2024

#614 in HTTP server

GPL-3.0 license

145KB
4.5K SLoC

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

  1. Basic Hello World
  2. How to Limit Body Size
  3. How to Use Cookies
  4. How to Set Up Cross-Origin Resource Sharing (CORS)
  5. How to Customize Errors
  6. How to Customize Extractors for Parameters
  7. How to Customize Responses
  8. How to Extract FormData
  9. How to Extract FormUrlencoded Data
  10. How to Use Logging
  11. How to Extract JSON
  12. How to Customize Middleware
  13. How to Extract URL Path Parameters
  14. How to Extract URL Query Parameters
  15. How to Redirect
  16. How to Use Routing
  17. How to Use Sessions
  18. How to Use Server-Sent Events (SSE)
  19. How to Use Global State
  20. How to Proxy Static Folders
  21. How to Upload Files
  22. How to Use WebSockets

Dependencies

~12–26MB
~466K SLoC