Skip to content

Commit

Permalink
exinude example
Browse files Browse the repository at this point in the history
  • Loading branch information
Jzow committed Aug 17, 2023
1 parent 466c970 commit 63b19cf
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ members = [
"summer-boot-actuator",
"summer-boot-autoconfigure",
"summer-boot-macro",
"example",
]
"example"
]
2 changes: 1 addition & 1 deletion example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ schemars = "0.8.8"
tokio = { version = "1.19.2", features = ["full"] }

#summer
summer-boot = { version = "1.0.0", path = "../summer-boot" }
summer-boot = { version = "1.0.0"}
2 changes: 1 addition & 1 deletion example/src/log.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use summer_boot::log;


#[cfg(test)]
mod test {
Expand Down
16 changes: 15 additions & 1 deletion example/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
mod http_method;
use serde::Deserialize;
use summer_boot::{Request, Result};


#[derive(Debug, Deserialize)]
struct User {
name: String,
age: u16,
}

#[summer_boot::auto_scan]
#[summer_boot::main]
async fn main() {
summer_boot::run();
}

#[summer_boot::post("/test/api")]
async fn test_api(mut req: Request<()>) -> Result {
let User { name, age } = req.body_json().await?;
Ok(format!("Hello, {}! {} years old", name, age).into())
}
2 changes: 1 addition & 1 deletion summer-boot-autoconfigure/src/read_yml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,4 @@ pub fn load_conf() -> Option<GlobalConfig> {
return load_global_config(init.profiles.active);
}
None
}
}

0 comments on commit 63b19cf

Please sign in to comment.