feat: implement submission of reports
This commit is contained in:
parent
1eb112527b
commit
828084a0dd
|
@ -926,6 +926,7 @@ dependencies = [
|
|||
"rocket_codegen",
|
||||
"rocket_http",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"state",
|
||||
"tempfile",
|
||||
"time",
|
||||
|
|
|
@ -8,9 +8,7 @@ publish = false
|
|||
include = ["src/**/*", "LICENSE-*", "README.md"]
|
||||
description = "Web app and backend service to ingest Kotlin Build Reports"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.65"
|
||||
rocket = "0.5.0-rc.2"
|
||||
serde = "1.0.144"
|
||||
rocket = { version = "0.5.0-rc.2", features = ["json"] }
|
||||
serde = { version = "1.0.144", features = ["derive"] }
|
||||
|
|
15
src/main.rs
15
src/main.rs
|
@ -1,15 +1,20 @@
|
|||
#[macro_use] extern crate rocket;
|
||||
#[macro_use]
|
||||
extern crate rocket;
|
||||
mod metric;
|
||||
mod metric_conv;
|
||||
mod metric_name;
|
||||
mod model;
|
||||
|
||||
#[get("/")]
|
||||
fn index() -> &'static str {
|
||||
"Hello, world!"
|
||||
use crate::model::CompileStatisticsData;
|
||||
use rocket::serde::json::Json;
|
||||
|
||||
#[post("/", data = "<data>", format = "json")]
|
||||
fn submit_report(data: Json<CompileStatisticsData>) -> String {
|
||||
let data = data.into_inner();
|
||||
data.build_uuid.to_owned()
|
||||
}
|
||||
|
||||
#[launch]
|
||||
fn rocket() -> _ {
|
||||
rocket::build().mount("/", routes![index])
|
||||
rocket::build().mount("/", routes![submit_report])
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue