Commit 9383784b authored by Katharina Fey's avatar Katharina Fey 🏴
Browse files

alskdakds

parent 49643577
......@@ -733,6 +733,7 @@ dependencies = [
"keybob 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"miscreant 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_yaml 0.8.8 (registry+https://github.com/rust-lang/crates.io-index)",
"textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
......
......@@ -7,6 +7,7 @@ edition = "2018"
[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.8"
serde_json = "1.0"
actix-web = "1.0.0-beta.1"
clap = "2.33"
......
use actix_web::{middleware, web, App, HttpRequest, HttpResponse, HttpServer};
use std::{env, thread};
use actix_web::{
middleware,
web::{self, Json},
App, HttpRequest, HttpResponse, HttpServer,
};
use serde_json::Value;
use std::{collections::HashMap, env, thread};
mod utils {
pub use crate::*;
......@@ -31,9 +36,13 @@ impl Params {
}
/// simple handle
fn index(state: web::Data<Params>, req: HttpRequest) -> HttpResponse {
println!("{:?}", req);
fn index(
state: web::Data<Params>,
(json, req): (Json<Option<HashMap<String, Value>>>, HttpRequest),
) -> HttpResponse {
let h = req.headers();
println!("{:?}", json);
let _ = h
.get("x-gitlab-event")
.expect("Request didn't include `x-gitlab-event`")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment