blob: bf5f6b0bc45f4cb77883e5a41c6561a2a1d9ec30 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
use std::env;
// use gradecoin::error;
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=gradecoin=debug`
if env::var_os("RUST_LOG").is_none() {
env::set_var("RUST_LOG", "gradecoin=debug");
}
log4rs::init_file("log.conf.yml", Default::default()).unwrap();
let db = create_database();
let api = consensus_routes(db);
// let routes = api.with(warp::log("gradecoin"));
// Start the server
let point = ([127, 0, 0, 1], 8080);
warp::serve(api).run(point).await;
}
|