Skip to content

Commit

Permalink
feat: prevencion spam 🛑
Browse files Browse the repository at this point in the history
  • Loading branch information
eerii committed Jan 29, 2024
1 parent 5bb8070 commit 817fae8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
7 changes: 1 addition & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ pub fn init_tracing() {
let timer = time::format_description::parse("[hour]:[minute]:[second]").unwrap_or_default();
let offset = time::UtcOffset::current_local_offset().unwrap_or(time::UtcOffset::UTC);
let timer = OffsetTime::new(offset, timer);

let level = if cfg!(debug_assertions) {
"cinemazarelos=debug,tower_http=debug"
} else {
"cinemazarelos=debug,tower_http=info"
};
let level = "cinemazarelos=debug,tower_http=debug";

tracing_subscriber::registry()
.with(
Expand Down
10 changes: 3 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,15 @@ async fn main() {
};

// Lanzar o servidor
let listener = TcpListener::bind("0.0.0.0:3000")
.await
.expect("Fallo ó crear o servidor");
let listener = TcpListener::bind("0.0.0.0:3000").await.unwrap();

info!(
"Servidor activo en http://{}",
listener
.local_addr()
.expect("Fallo obtendo o enderezo do servidor")
listener.local_addr().unwrap()
);

axum::serve(listener, app)
.with_graceful_shutdown(shutdown_signal())
.await
.expect("Fallo executando o servidor");
.unwrap();
}

0 comments on commit 817fae8

Please sign in to comment.