Skip to content
Snippets Groups Projects
Commit de7bf87d authored by Jan Vaorin's avatar Jan Vaorin
Browse files

Update main.rs

parent 137c11de
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
...@@ -18,6 +18,7 @@ async fn main() -> miette::Result<()> { ...@@ -18,6 +18,7 @@ async fn main() -> miette::Result<()> {
} }
let router = Router::<()>::new() let router = Router::<()>::new()
.route("/", get(home)) .route("/", get(home))
.route("/sagichimmer", get(schmfy_sagichimmer))
.route("/schmfy", get(schmfy).post(schmfy_post)); .route("/schmfy", get(schmfy).post(schmfy_post));
let address = std::env::var(SCHMFY_HOST) let address = std::env::var(SCHMFY_HOST)
...@@ -68,6 +69,11 @@ async fn schmfy_post(Json(Input { input }): Json<Input>) -> String { ...@@ -68,6 +69,11 @@ async fn schmfy_post(Json(Input { input }): Json<Input>) -> String {
schmfy::schmfy(input.as_str()) schmfy::schmfy(input.as_str())
} }
async fn schmfy_sagichimmer(Query(Input { input }): Query<Input>) -> String {
let s = schmfy::schmfy(input.as_str());
format!("{}, {} sag ich immer",input.as_str(),s)
}
async fn shutdown_signal() { async fn shutdown_signal() {
let ctrl_c = async { let ctrl_c = async {
signal::ctrl_c() signal::ctrl_c()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment