kit_rs/
lib.rs

1pub mod http;
2pub mod inertia;
3pub mod routing;
4pub mod server;
5
6pub use http::{json, text, HttpResponse, Request, Response, ResponseExt};
7pub use inertia::{InertiaConfig, InertiaContext, InertiaResponse};
8pub use routing::Router;
9pub use server::Server;
10
11// Re-export for macro usage
12#[doc(hidden)]
13pub use serde_json;
14
15// Re-export serde for InertiaProps derive macro
16pub use serde;
17
18// Re-export the proc-macros for compile-time component validation and type safety
19pub use kit_macros::inertia_response;
20pub use kit_macros::InertiaProps;
21
22#[macro_export]
23macro_rules! json_response {
24    ($($json:tt)+) => {
25        Ok($crate::HttpResponse::json($crate::serde_json::json!($($json)+)))
26    };
27}
28
29#[macro_export]
30macro_rules! text_response {
31    ($text:expr) => {
32        Ok($crate::HttpResponse::text($text))
33    };
34}