forked from nulltea/zkTripster
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[workspace] | ||
[package] | ||
version = "0.1.0" | ||
name = "bid-server" | ||
edition = "2021" | ||
|
||
|
||
[dependencies] | ||
rocket = "0.5.1" | ||
cli-batteries = "0.5" | ||
|
||
[build-dependencies] | ||
cli-batteries = "0.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
cli_batteries::build_rs().unwrap() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#[macro_use] extern crate rocket; | ||
|
||
use rocket::{Rocket, Build}; | ||
|
||
#[get("/")] | ||
fn index() -> &'static str { | ||
"Hello, world!" | ||
} | ||
|
||
fn rocket() -> Rocket<Build> { | ||
rocket::build() | ||
// .mount("/", routes![hello, hello]) // uncomment this to get an error | ||
// .mount("/", routes![unmanaged]) // uncomment this to get a sentinel error | ||
.mount("/", routes![index]) | ||
} | ||
|
||
#[derive(Parser)] | ||
#[group(skip)] | ||
struct Options { | ||
/// File to read | ||
#[clap(long, env, default_value = "")] | ||
proofPath: PathBuf, | ||
} | ||
|
||
|
||
async fn app(options: Options) -> Result<()> { | ||
let mut proof = File::open(options.proofPath).await?; | ||
// verify | ||
Ok(()) | ||
} | ||
|
||
fn main() { | ||
if let Err(e) = rocket().launch().await { | ||
println!("Whoops! Rocket didn't launch!"); | ||
// We drop the error to get a Rocket-formatted panic. | ||
drop(e); | ||
}; | ||
} |