rocket_launch.rs
RAW

// main.rs

extern crate rocket;

#[derive(Serialize, Deserialize)]
struct Message {
   contents: String,
}

#[put("/<id>", data = "<message>")]
fn update(id: ID, message: Json<Message>) -> Json<Value> {
    if DB.contains_key(&id) {
        DB.insert(id, &message.contents);
        Json(json!{ "status": "ok" })
    } else {
        Json(json!{ "status": "error" })
    }
}