From 17d73bb73f4396c22ca24c3839a5449f5e28b4e5 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Tue, 13 Apr 2021 04:05:44 +0300 Subject: Housekeeping Moved tests out of routes.rs into their own file Learned how to use lib.rs, now we have cargo doc support as well --- src/bin/main.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/bin/main.rs (limited to 'src/bin') diff --git a/src/bin/main.rs b/src/bin/main.rs new file mode 100644 index 0000000..8d88286 --- /dev/null +++ b/src/bin/main.rs @@ -0,0 +1,25 @@ +use std::env; +use warp::Filter; + +use gradecoin::routes::consensus_routes; +use gradecoin::schema::create_database; + +// mod validators; + +#[tokio::main] +async fn main() { + // Show debug logs by default by setting `RUST_LOG=restful_rust=debug` + if env::var_os("RUST_LOG").is_none() { + env::set_var("RUST_LOG", "gradecoin=debug"); + } + pretty_env_logger::init(); + + let db = create_database(); + + let api = consensus_routes(db); + + let routes = api.with(warp::log("gradecoin")); + + // Start the server + warp::serve(routes).run(([127, 0, 0, 1], 8080)).await; +} -- cgit v1.2.3-70-g09d2