generated from Patagia/template-nix
This commit is contained in:
parent
3e859b5d8c
commit
6de14bb200
1 changed files with 12 additions and 1 deletions
|
@ -43,13 +43,24 @@ struct VersionInfo {
|
|||
method = GET,
|
||||
path = "/version",
|
||||
}]
|
||||
#[tracing::instrument()]
|
||||
#[tracing::instrument(
|
||||
skip(rqctx),
|
||||
fields(
|
||||
http.method=rqctx.request.method().as_str(),
|
||||
http.path=rqctx.request.uri().path(),
|
||||
http.remote_ip=rqctx.request.remote_addr().ip().to_string(),
|
||||
request_id = rqctx.request_id,
|
||||
),
|
||||
err(Debug),
|
||||
)]
|
||||
async fn api_version(
|
||||
rqctx: RequestContext<Arc<()>>,
|
||||
) -> Result<HttpResponseOk<VersionInfo>, HttpError> {
|
||||
let ver = VersionInfo {
|
||||
name: String::from("patagia-controller"),
|
||||
};
|
||||
|
||||
tracing::info!("Someone made a request to /version");
|
||||
Ok(HttpResponseOk(ver))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue