Skip to content

Commit

Permalink
rocket
Browse files Browse the repository at this point in the history
gordon-to committed May 25, 2024
1 parent 57e3a0f commit 120d759
Showing 3 changed files with 54 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sp1_prover/bid-server/Cargo.toml
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"
3 changes: 3 additions & 0 deletions sp1_prover/bid-server/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
cli_batteries::build_rs().unwrap()
}
38 changes: 38 additions & 0 deletions sp1_prover/bid-server/src/main.rs
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);
};
}

0 comments on commit 120d759

Please sign in to comment.