FlashAPI

FlashAPI

A lightweight webserver framework for Rust, designed to be simple and minimal.

Crates.ioDocs.rsLicense: MIT
Why FlashAPI?

Features

Everything you need to build fast and efficient web servers in Rust

Lightweight

Minimal dependencies and a small footprint for fast compilation and runtime performance.

Simple API

Easy routing with handler functions and an intuitive API for quick prototyping.

JSON Support

Built-in JSON response support via serde and serde_json for modern web APIs.

Quick Prototyping

Get your web server up and running in minutes with minimal boilerplate code.

Minimal

Few dependencies

Fast

Blazing performance

Simple

Easy to learn

Installation

Add FlashAPI to your Rust project in seconds

Add to your Cargo.toml:

1[dependencies]
2flashapi = "0.2.2"

Examples

Learn by example with common use cases

Start Server and Register Routes

Create a new HTTP server and register GET and POST handlers.

1#[tokio::main]
2async fn main() {
3    let mut server = HttpServer::new().with_state(());
4
5    server.get(String::from("/user"), get_handler);
6    server.post(String::from("/user"), post_handler);
7
8    let _ = server.listen(Some(8000)).await;
9}