aboutsummaryrefslogtreecommitdiff
path: root/src/request.gleam
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-04-17 17:13:51 +0000
committerFuwn <[email protected]>2026-04-17 17:13:51 +0000
commit6089ff1b9fc921d6aa85287ee52abae951b1bfe0 (patch)
tree8184df13e7707fe8469f47f2645a6ea42797d243 /src/request.gleam
parentchore(gleam.toml): Bump version (diff)
downloadmayu-6089ff1b9fc921d6aa85287ee52abae951b1bfe0.tar.xz
mayu-6089ff1b9fc921d6aa85287ee52abae951b1bfe0.zip
perf: Reduce per-request work and I/O in render pipeline
Diffstat (limited to 'src/request.gleam')
-rw-r--r--src/request.gleam17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/request.gleam b/src/request.gleam
index 5ef74c1..82048af 100644
--- a/src/request.gleam
+++ b/src/request.gleam
@@ -1,9 +1,7 @@
import database
-import envoy
import gleam/int
import gleam/json
import gleam/list
-import gleam/string
import gleam/string_builder
import svg
import wisp
@@ -25,20 +23,7 @@ pub fn handle(request, connection, image_cache, index_html) {
[] ->
case index_html {
"" -> wisp.not_found()
- content ->
- wisp.html_response(
- string_builder.from_string(
- string.replace(
- content,
- "{{ MAYU_VERSION }}",
- case envoy.get("MAYU_VERSION") {
- Ok(version) -> "(v" <> version <> ")"
- Error(_) -> ""
- },
- ),
- ),
- 200,
- )
+ content -> wisp.html_response(string_builder.from_string(content), 200)
}
["heart-beat"] ->
wisp.html_response(string_builder.from_string("alive"), 200)