feat: basic server structure done

This commit is contained in:
2025-01-12 00:56:07 +01:00
parent 2225fa870e
commit 170282cace
3 changed files with 31 additions and 43 deletions

View File

@@ -7,16 +7,16 @@ pub struct HttpAppConfig {
port: u8,
}
pub type HttpAppRouteFunction = Box<dyn Fn(HttpRequest) -> String>;
pub type HttpAppRouteFunction = Box<fn(HttpRequest) -> String>;
pub struct HttpAppRoute<'a> {
route: &'a str,
action: HttpAppRouteFunction,
pub struct HttpAppRoute {
pub route: String,
pub action: HttpAppRouteFunction,
}
pub struct HttpApp<'a> {
config: HttpAppConfig,
routes: Vec<HttpAppRoute<'a>>,
pub struct HttpApp {
pub config: HttpAppConfig,
pub routes: Vec<HttpAppRoute>,
}
/*