roast

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

rocket.rs (850B)


      1 #![feature(decl_macro)]
      2 
      3 #[macro_use]
      4 extern crate rocket;
      5 
      6 use rocket::State;
      7 use rocket_contrib::json::Json;
      8 use std::collections::BTreeMap;
      9 use std::{error::Error, sync::Mutex};
     10 
     11 use schnorr_fun::frost::Nonce;
     12 use schnorr_fun::{frost::PointPoly, fun::Scalar, Signature};
     13 
     14 #[derive(Debug)]
     15 pub struct RoastDatabase {}
     16 
     17 // #[derive(Serialize, Deserialize, Clone)]
     18 // pub struct Response<'a, T> {
     19 //     data: T,
     20 //     message: &'a str,
     21 // }
     22 
     23 #[post("/submit_signature", data = "<signature>")]
     24 pub fn send_signature(roast_db: State<'_, Mutex<RoastDatabase>>, signature: String) -> () {}
     25 
     26 fn main() -> Result<(), Box<dyn Error>> {
     27     rocket::ignite()
     28         .manage(Mutex::new(RoastDatabase {}))
     29         .mount(
     30             "/",
     31             routes![
     32                 send_signature,   //post
     33             ],
     34         )
     35         .launch();
     36     Ok(())
     37 }