summaryrefslogtreecommitdiffstats
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
commit17d73bb73f4396c22ca24c3839a5449f5e28b4e5 (patch)
tree06b90d76e40101b462f2ddcfa89c768d78279ed6 /src/main.rs
parent0cc703bc74539f123d57d2d392eaf6b99eca26e7 (diff)
downloadgradecoin-17d73bb73f4396c22ca24c3839a5449f5e28b4e5.tar.gz
gradecoin-17d73bb73f4396c22ca24c3839a5449f5e28b4e5.tar.bz2
gradecoin-17d73bb73f4396c22ca24c3839a5449f5e28b4e5.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}