krustie 0.1.7

Krustie is a backend framework written in Rust. Currently, it is a work in progress and not yet ready for production use.
Documentation

Krustie - A Basic Backend Framework

Krustie is a backend framework written in Rust. It is currently a work in progress and not yet ready for production use. This project serves as a personal learning experience, and contributions or feedback are welcome.

Features

  • Basic request and response handling
  • Stackable Router
  • General Middleware support
  • Router Middleware support
  • JSON parsing (serde_json)

Builtin Middlewares

  • Static file serving
  • Gzip encoding (flate2)

Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

Installation

Add Krustie to your project

Include it in your Cargo.toml:

[dependencies]

krustie = "0.1.6"

Run the following Cargo command in your project directory:

cargo add krustie

Start your server

use krustie::{ Server, Router, StatusCodes };

fn main() {
    let mut server = Server::create();
    let mut router = Router::new();

    router.get(|_, res| {
        res.status(StatusCode::Ok)
            .body(b"Hello World!".to_vec(), "text/plain");
    });

    server.use_handler(router);

    server.listen((127, 0, 0, 1), 8080);
}

Run your server

cargo run

Contributing

As an inexperienced developer contributions will be welcomed. Please open an issue or a pull request.