From 6f7c47a33caae84e2f99ad3bfe61a4bd0176bd1a Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 13 Feb 2021 09:50:42 +0100 Subject: Add status page --- src/controller/utils.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/controller') diff --git a/src/controller/utils.rs b/src/controller/utils.rs index 225f8a4..544cdf8 100644 --- a/src/controller/utils.rs +++ b/src/controller/utils.rs @@ -96,6 +96,18 @@ pub fn template( ) } +pub fn text(str: String) -> Response { + let mut response = Response::new(str.into()); + *response.status_mut() = StatusCode::OK; + response +} + +pub fn ok() -> Response { + let mut response = Response::default(); + *response.status_mut() = StatusCode::OK; + response +} + pub fn redirect(uri: &str) -> Response { let mut response = Response::default(); *response.status_mut() = StatusCode::MOVED_PERMANENTLY; -- cgit v1.2.3