Expand description

Cataclysm: A simple http framework

Cataclysm is a small personal project, an http framework influenced by actix-web, and built over tokio. A minimal working example is the following

extern crate cataclysm;
 
use cataclysm::{Server, Branch, http::{Response, Method}};
 
async fn index() -> Response {
    Response::ok().body("Hello, World!")
}
 
#[tokio::main]
async fn main() {
    let server = Server::builder(
        Branch::<()>::new("/").with(Method::Get.to(index))
    ).build().unwrap();
 
    server.run("localhost:8000").await.unwrap();
}

Modules

Contains the specific functionality for http interaction
Contains usefull stuff for session management
Contains some basic websockets functionality

Structs

Wrapper for additional shared data in the server
Main cataclysm structure for route handling
Inner cors structure
Cors builder structure
Http Server instance
Builder pattern for the server structure
Wrapper around data to be shared in the server

Enums

Errors returned by this library
Pipeline type, contains either a layer or the core of the pipeline

Traits

Callback trait, for http callbacks
Extractor trait

Type Definitions

Type for the core handlers, that is, the ones that actually create a response
Type representing middleware functions