WIP on proxy pulse map

This commit is contained in:
Dominik Werder
2021-09-20 21:17:25 +02:00
parent e1e930f453
commit b54b31fe98
6 changed files with 99 additions and 4 deletions

View File

@@ -106,6 +106,15 @@ where
impl<F> UnwindSafe for Cont<F> {}
pub fn response_err<T>(status: StatusCode, msg: T) -> Result<Response<Body>, Error>
where
T: AsRef<str>,
{
let msg = format!("Error:\n\n{}\n\nDocumentation:\nhttps://data-api.psi.ch/api/1/documentation/\nhttps://data-api.psi.ch/api/4/documentation/", msg.as_ref());
let ret = response(status).body(Body::from(msg))?;
Ok(ret)
}
macro_rules! static_http {
($path:expr, $tgt:expr, $tgtex:expr, $ctype:expr) => {
if $path == concat!("/api/4/documentation/", $tgt) {