From bf17f200243f227f8f0c3d9a991dd9e6ba28f9b7 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Mon, 10 Jun 2024 21:25:57 +0200 Subject: [PATCH 1/3] adding endpoint with parameter --- .gitignore | 3 ++- src/main/kotlin/quest/lengrand/plugins/Routing.kt | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c426c32..498277c 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,5 @@ out/ /.nb-gradle/ ### VS Code ### -.vscode/ \ No newline at end of file +.vscode/ +.DS_Store diff --git a/src/main/kotlin/quest/lengrand/plugins/Routing.kt b/src/main/kotlin/quest/lengrand/plugins/Routing.kt index 573f559..1929011 100644 --- a/src/main/kotlin/quest/lengrand/plugins/Routing.kt +++ b/src/main/kotlin/quest/lengrand/plugins/Routing.kt @@ -9,5 +9,9 @@ fun Application.configureRouting() { get("/") { call.respondText("Hello World!") } + + get("/user/{name}"){ + call.respondText("Hello ${call.parameters["name"]}!") + } } } From 4ba138c65c22388306ce7957b1d07693170a01ca Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Mon, 10 Jun 2024 22:40:33 +0200 Subject: [PATCH 2/3] Testing automated preview deployments --- src/main/kotlin/quest/lengrand/plugins/Routing.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/kotlin/quest/lengrand/plugins/Routing.kt b/src/main/kotlin/quest/lengrand/plugins/Routing.kt index 1929011..86b3aff 100644 --- a/src/main/kotlin/quest/lengrand/plugins/Routing.kt +++ b/src/main/kotlin/quest/lengrand/plugins/Routing.kt @@ -13,5 +13,9 @@ fun Application.configureRouting() { get("/user/{name}"){ call.respondText("Hello ${call.parameters["name"]}!") } + + get("/mood/{mood}"){ + call.respondText("Feeling ${call.parameters["mood"]}?") + } } } From 08f2dee9e317dcd96bea279e5e13f3ff3d70f133 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Mon, 10 Jun 2024 22:43:38 +0200 Subject: [PATCH 3/3] Deployments are now active --- src/main/kotlin/quest/lengrand/plugins/Routing.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/quest/lengrand/plugins/Routing.kt b/src/main/kotlin/quest/lengrand/plugins/Routing.kt index 86b3aff..f6feb03 100644 --- a/src/main/kotlin/quest/lengrand/plugins/Routing.kt +++ b/src/main/kotlin/quest/lengrand/plugins/Routing.kt @@ -15,7 +15,7 @@ fun Application.configureRouting() { } get("/mood/{mood}"){ - call.respondText("Feeling ${call.parameters["mood"]}?") + call.respondText("Are you feeling ${call.parameters["mood"]}?") } } }