-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
consolidate routes, partly implement HTCPCP
- Loading branch information
1 parent
108cf01
commit 76b9ffe
Showing
5 changed files
with
28 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
use axum::{http::StatusCode, routing::get, Router}; | ||
|
||
pub fn route() -> Router { | ||
Router::new().route("/health", get(health())) | ||
Router::new() | ||
.route("/live", get(empty())) | ||
.route("/health", get(empty())) | ||
} | ||
|
||
fn health() -> StatusCode { | ||
fn empty() -> StatusCode { | ||
StatusCode::OK | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
use axum::Router; | ||
|
||
pub mod health; | ||
pub mod splash; | ||
pub mod teapot; | ||
|
||
pub fn routes() -> Router { | ||
Router::new() | ||
.merge(health::route()) | ||
.merge(splash::route()) | ||
.merge(teapot::route()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use axum::{http::StatusCode, routing::get, Router}; | ||
|
||
pub fn route() -> Router { | ||
Router::new() | ||
.route("/brew-coffee", get(refuse_to_brew_coffee())) | ||
.route("/brew", get(refuse_to_brew_coffee())) | ||
} | ||
|
||
fn refuse_to_brew_coffee() -> StatusCode { | ||
StatusCode::IM_A_TEAPOT | ||
} |