aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorYigit Sever2021-04-13 04:05:44 +0300
committerYigit Sever2021-04-13 04:05:49 +0300
commitb06cbd69fc2a7544f6f62c20cbdfb30bda194101 (patch)
treee639c13328c3c0083f3f343fb5633290ec2bf29c /src/main.rs
parent42cad1e409727ae8e1fd9f9d1c0b520e9c0565f8 (diff)
downloadgradecoin-b06cbd69fc2a7544f6f62c20cbdfb30bda194101.tar.gz
gradecoin-b06cbd69fc2a7544f6f62c20cbdfb30bda194101.tar.bz2
gradecoin-b06cbd69fc2a7544f6f62c20cbdfb30bda194101.zip
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
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/main.rs b/src/main.rs
deleted file mode 100644
index 5683aea..0000000
--- a/src/main.rs
+++ /dev/null
@@ -1,26 +0,0 @@
1use gradecoin::schema::create_database;
2use std::env;
3use warp::Filter;
4
5mod custom_filters;
6mod handlers;
7mod routes;
8// mod validators;
9
10#[tokio::main]
11async fn main() {
12 // Show debug logs by default by setting `RUST_LOG=restful_rust=debug`
13 if env::var_os("RUST_LOG").is_none() {
14 env::set_var("RUST_LOG", "gradecoin=debug");
15 }
16 pretty_env_logger::init();
17
18 let db = create_database();
19
20 let api = routes::consensus_routes(db);
21
22 let routes = api.with(warp::log("gradecoin"));
23
24 // Start the server
25 warp::serve(routes).run(([127, 0, 0, 1], 8080)).await;
26}