Skip to main content

ullun/
lib.rs

1//! # ullun-api
2//!
3//! Express.js-inspired web framework for Rust.
4//!
5//! ## Quick Start
6//!
7//! ```no_run
8//! use ullun::prelude::*;
9//!
10//! #[tokio::main]
11//! async fn main() {
12//!     App::new()
13//!         .get_with_params("/hello/{name}", |params: Params| async move {
14//!             Ok(Response::json(serde_json::json!({
15//!                 "message": format!("Hello, {}!", params.get("name").unwrap())
16//!             })))
17//!         })
18//!         .run("127.0.0.1:3000")
19//!         .await
20//!         .unwrap();
21//! }
22//! ```
23
24pub mod app;
25pub mod cookies;
26pub mod error;
27pub mod handler;
28pub mod middleware;
29pub mod request;
30pub mod response;
31pub mod router;
32pub mod static_files;
33
34pub mod prelude {
35    pub use crate::app::{App, RouteGroup};
36    pub use crate::cookies::{Cookie, Cookies};
37    pub use crate::error::{Error, Result};
38    pub use crate::handler::Handler;
39    pub use crate::middleware::{Middleware, Next};
40    pub use crate::request::{Params, Query, Request};
41    pub use crate::response::{Json, Response};
42    pub use crate::router::Router;
43    pub use async_trait::async_trait;
44    pub use serde::{Deserialize, Serialize};
45}