Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
zachkirlew committed Mar 10, 2024
1 parent 3e731fe commit a23ff4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
use actix_web::{web, App, HttpServer, Responder, HttpResponse};
use actix_web::dev::Server;
use actix_web::{web, App, HttpResponse, HttpServer, Responder};

async fn healthcheck() -> impl Responder {
HttpResponse::Ok()
}

pub fn run() -> Result<Server, std::io::Error> {
let server = HttpServer::new(|| {
App::new()
.route("/health-check", web::get().to(healthcheck))
})
let server = HttpServer::new(|| App::new().route("/health-check", web::get().to(healthcheck)))
.bind("127.0.0.1:8000")?
.run();
Ok(server)
}
}
2 changes: 1 addition & 1 deletion tests/healthcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ async fn health_check_works() {
fn spawn_app() {
let server = email_newsletter_api::run().expect("Failed to bind address");
let _ = tokio::spawn(server);
}
}

0 comments on commit a23ff4a

Please sign in to comment.