Skip to content

Commit d3bf2a2

Browse files
authored
fix health check route and update response (#49)
* fix health check route and update response * refactor CI workflow: reorder cargo commands for improved clarity
1 parent 7c93b3d commit d3bf2a2

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

.github/workflows/pr_test.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@ jobs:
2020
profile: minimal
2121
override: true
2222

23-
- name: Run cargo update --locked
24-
run: cargo update --locked
23+
- name: Run cargo build
24+
run: cargo build
2525

2626
- name: Run cargo test
2727
run: cargo test
28-
29-
- name: Run cargo build
30-
run: cargo build

src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ async fn main() -> ExitCode {
4949
errors::catchers::handle_400,
5050
],
5151
)
52+
.mount("/", openapi_get_routes![routes::health,])
53+
.mount("/health", openapi_get_routes![routes::health,])
5254
.mount(
5355
"/v1",
5456
openapi_get_routes![
55-
routes::healthy,
57+
routes::health,
5658
routes::policies::get_policies,
5759
routes::policies::get_policy,
5860
routes::policies::create_policy,

src/routes/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use rocket::get;
2-
use rocket::response::status;
32
use rocket_okapi::openapi;
43

54
pub mod authorization;
@@ -9,6 +8,6 @@ pub mod schema;
98

109
#[openapi]
1110
#[get("/")]
12-
pub async fn healthy() -> status::NoContent {
13-
status::NoContent
11+
pub async fn health() -> &'static str {
12+
"ok"
1413
}

0 commit comments

Comments
 (0)