aboutsummaryrefslogtreecommitdiff
path: root/src/request.gleam
diff options
context:
space:
mode:
Diffstat (limited to 'src/request.gleam')
-rw-r--r--src/request.gleam14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/request.gleam b/src/request.gleam
index d9abccf..6e23caf 100644
--- a/src/request.gleam
+++ b/src/request.gleam
@@ -1,5 +1,7 @@
import database
+import envoy
import gleam/json
+import gleam/string
import gleam/string_builder
import simplifile
import svg
@@ -22,7 +24,17 @@ pub fn handle(request, connection) {
[] ->
case simplifile.read("index.html") {
Ok(content) ->
- wisp.html_response(string_builder.from_string(content), 200)
+ wisp.html_response(
+ string_builder.from_string(
+ string.replace(content, "{{ MAYU_VERSION }}", case
+ envoy.get("MAYU_VERSION")
+ {
+ Ok(version) -> "(v" <> version <> ")"
+ Error(_) -> ""
+ }),
+ ),
+ 200,
+ )
Error(_) -> wisp.not_found()
}
["heart-beat"] ->