Skip to content

Commit

Permalink
hotfix: public func for web api examples (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBoji committed Oct 5, 2024
1 parent 0b15f56 commit 6267c50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ edition = "2021"
[dependencies]
rayon = "1.5"
tokio = { version = "1", features = ["full"] }
actix-web = "4"
actix-web = "4"
serde = { version = "1.0", features = ["derive"] }
2 changes: 1 addition & 1 deletion src/day16_to_day18/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ mod web_development;

pub fn run() {
println!("Days 16-18: Web Development");
web_development::examples();
web_development::main();
}
4 changes: 2 additions & 2 deletions src/day16_to_day18/web_development.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ async fn create_user(user: web::Json<User>) -> impl Responder {

// server
#[actix_web::main]
async fn main() -> std::io::Result<()> {
println!("Khởi động máy chủ web tại http://127.0.0.1:8080");
pub async fn main() -> std::io::Result<()> {
println!("Deploy web server at http://127.0.0.1:8080");

HttpServer::new(|| {
App::new()
Expand Down

0 comments on commit 6267c50

Please sign in to comment.