feat(test): health_check route
This commit is contained in:
16
src/lib.rs
Normal file
16
src/lib.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
use actix_web::{web, App, HttpResponse, HttpServer, Responder};
|
||||
|
||||
async fn healthcheck_route() -> impl Responder{
|
||||
return HttpResponse::Ok().finish()
|
||||
}
|
||||
|
||||
|
||||
pub async fn run() -> Result<(), std::io::Error>{
|
||||
HttpServer::new(||{
|
||||
App::new()
|
||||
.route("/healthcheck", web::get().to(healthcheck_route))
|
||||
})
|
||||
.bind("127.0.0.1:8000")?
|
||||
.run()
|
||||
.await
|
||||
}
|
@@ -1,3 +1,6 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
use email_newsletter_api::run;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), std::io::Error>{
|
||||
run().await
|
||||
}
|
||||
|
Reference in New Issue
Block a user