-
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.
- Loading branch information
Showing
4 changed files
with
29 additions
and
7 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,3 +1,5 @@ | ||
mod api_controller; | ||
mod is_alive_action; | ||
mod models; | ||
pub use api_controller::ApiController; | ||
pub use is_alive_action::*; | ||
mod ping_action; | ||
pub use ping_action::*; |
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,20 @@ | ||
use my_http_server::{macros::http_route, HttpContext, HttpFailResult, HttpOkResult, HttpOutput}; | ||
|
||
#[http_route( | ||
method: "GET", | ||
route: "/api/Ping", | ||
controller: "Monitoring", | ||
description: "Endpoint to ping the service", | ||
summary: "Endpoint to ping the service", | ||
result:[ | ||
{status_code: 204, description: "Ok result"}, | ||
] | ||
)] | ||
pub struct PingAction; | ||
|
||
async fn handle_request( | ||
_: &PingAction, | ||
_ctx: &mut HttpContext, | ||
) -> Result<HttpOkResult, HttpFailResult> { | ||
HttpOutput::Empty.into_ok_result(false).into() | ||
} |
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