1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! # AWS Lambda Router
//!
//! A lightweight, Express-like REST API routing framework for AWS Lambda functions
//! behind CloudFront with support for middleware, authentication, and CORS.
//!
//! ## Features
//! - Express-like routing with path parameters
//! - Middleware support (auth, logging, CORS, etc.)
//! - Automatic CORS preflight handling
//! - Type-safe request/response handling
//! - Path parameter extraction
//! - Query string parsing
//! - JSON body parsing
//! - Error handling with proper HTTP status codes
//!
//! ## Example
//! ```rust,ignore
//! use aws_lambda_router::{Router, Request, Response, Context, handler};
//! use lambda_runtime::Error;
//! use serde_json::json;
//!
//! async fn get_user(req: Request, ctx: Context) -> aws_lambda_router::Result<Response> {
//! let user_id = req.path_param("userId").unwrap_or(&"unknown".to_string()).clone();
//! Ok(Response::ok(json!({
//! "userId": user_id,
//! "name": "John Doe"
//! })))
//! }
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Error> {
//! let mut router = Router::new();
//! router.get("/api/users/:userId", handler!(get_user));
//! lambda_runtime::run(router.into_service()).await
//! }
//! ```
// Re-export main types
pub use CorsConfig;
pub use ;
pub use PathMatcher;
pub use ;
pub use ;
pub use Response;
pub use ;
// The handler! macro is already exported via #[macro_export] in router.rs