From 23e4f52284ad5fa0b068220c54a255ff9fa7b18f Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Tue, 13 Apr 2021 20:37:54 +0300 Subject: Add verbose error messages Not happy with the solution one bit but using error.rs at https://blog.logrocket.com/create-an-async-crud-web-service-in-rust-with-warp/ was not working Basically we just handcraft every single response on the spot, there is some repetition and it's ugly but need to move on --- src/bin/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/bin') diff --git a/src/bin/main.rs b/src/bin/main.rs index 598a2e1..8b61e5c 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -1,6 +1,7 @@ use std::env; use warp::Filter; +// use gradecoin::error; use gradecoin::routes::consensus_routes; use gradecoin::schema::create_database; @@ -9,6 +10,7 @@ use gradecoin::schema::create_database; #[tokio::main] async fn main() { // Show debug logs by default by setting `RUST_LOG=gradecoin=debug` + // TODO: write logs to file? <13-04-21, yigit> // if env::var_os("RUST_LOG").is_none() { env::set_var("RUST_LOG", "gradecoin=debug"); } @@ -21,5 +23,6 @@ async fn main() { let routes = api.with(warp::log("gradecoin")); // Start the server - warp::serve(routes).run(([127, 0, 0, 1], 8080)).await; + let point = ([127, 0, 0, 1], 8080); + warp::serve(routes).run(point).await; } -- cgit v1.2.3-70-g09d2