diff options
author | Yigit Sever | 2021-04-13 04:05:44 +0300 |
---|---|---|
committer | Yigit Sever | 2021-04-13 04:05:49 +0300 |
commit | b06cbd69fc2a7544f6f62c20cbdfb30bda194101 (patch) | |
tree | e639c13328c3c0083f3f343fb5633290ec2bf29c /src/main.rs | |
parent | 42cad1e409727ae8e1fd9f9d1c0b520e9c0565f8 (diff) | |
download | gradecoin-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.rs | 26 |
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 @@ | |||
1 | use gradecoin::schema::create_database; | ||
2 | use std::env; | ||
3 | use warp::Filter; | ||
4 | |||
5 | mod custom_filters; | ||
6 | mod handlers; | ||
7 | mod routes; | ||
8 | // mod validators; | ||
9 | |||
10 | #[tokio::main] | ||
11 | async 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 | } | ||