volga/
lib.rs

1//! # Volga
2//!
3//! > Fast, Easy, and very flexible Web Framework for Rust based on [Tokio](https://tokio.rs/) runtime and [hyper](https://hyper.rs/) for fun and painless microservices crafting.
4//!
5//! ## Features
6//! * Supports HTTP/1 and HTTP/2
7//! * Robust routing
8//! * Custom middlewares
9//! * Dependency Injection
10//! * WebSockets and WebTransport
11//! * Full [Tokio](https://tokio.rs/) compatibility
12//! * Runs on stable Rust 1.80+
13//! 
14//! ## Example
15//! ```no_run
16//! use volga::*;
17//! 
18//! #[tokio::main]
19//! async fn main() -> std::io::Result<()> {
20//!     // Start the server
21//!     let mut app = App::new();
22//! 
23//!     // Example of a request handler
24//!     app.map_get("/hello/{name}", async |name: String| {
25//!          ok!("Hello {name}!")
26//!     });
27//!     
28//!     app.run().await
29//! }
30//! ```
31
32#![forbid(unsafe_code)]
33#![deny(unreachable_pub)]
34
35mod server;
36pub(crate) mod utils;
37
38pub mod app;
39pub mod http;
40pub mod headers;
41pub mod json;
42pub mod error;
43pub mod fs;
44#[cfg(feature = "di")]
45pub mod di;
46#[cfg(feature = "middleware")]
47pub mod middleware;
48#[cfg(feature = "tls")]
49pub mod tls;
50#[cfg(feature = "tracing")]
51pub mod tracing;
52#[cfg(feature = "ws")]
53pub mod ws;
54#[cfg(test)]
55pub mod test_utils;
56
57pub use crate::app::App;
58pub use crate::http::{
59    response::builder::{RESPONSE_ERROR, SERVER_NAME},
60    endpoints::args::{
61        cancellation_token::CancellationToken,
62        file::File,
63        json::Json,
64        path::Path,
65        query::Query,
66        form::Form,
67    },
68    BoxBody,
69    UnsyncBoxBody,
70    HttpBody,
71    HttpRequest,
72    HttpResponse,
73    HttpResult,
74    HttpHeaders,
75    ResponseContext,
76    Results
77};
78
79#[cfg(feature = "multipart")]
80pub use crate::http::endpoints::args::multipart::Multipart;
81
82pub mod routing {
83    pub use crate::app::router::RouteGroup;
84}
85
86