Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Commit

Permalink
CHORE: improve the handler namings
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenein committed Jul 28, 2022
1 parent c70cd05 commit aeab400
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rusty-tractive-telegram-bot/src/bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ pub async fn run(

info!("running the bot…");
let app = Route::new()
.at("/", post(on_update))
.at("/", head(health))
.at("/health", get(health))
.at("/health", head(health))
.at("/", post(post_update))
.at("/", head(get_health))
.at("/health", get(get_health))
.at("/health", head(get_health))
.with(AddData::new(api))
.with(AddData::new(SecretToken(secret_token)))
.with(TracingMiddleware);
Expand All @@ -53,13 +53,13 @@ pub async fn run(

#[handler]
#[instrument(skip_all)]
async fn health() -> StatusCode {
async fn get_health() -> StatusCode {
StatusCode::NO_CONTENT
}

#[handler]
#[instrument(skip_all)]
async fn on_update(
async fn post_update(
TypedHeader(SecretToken(secret_token)): TypedHeader<SecretToken>,
Json(update): Json<models::Update>,
bot_api: Data<&BotApi>,
Expand Down

0 comments on commit aeab400

Please sign in to comment.