diff options
| author | Fuwn <[email protected]> | 2026-04-17 17:13:51 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-04-17 17:13:51 +0000 |
| commit | 6089ff1b9fc921d6aa85287ee52abae951b1bfe0 (patch) | |
| tree | 8184df13e7707fe8469f47f2645a6ea42797d243 /src/request.gleam | |
| parent | chore(gleam.toml): Bump version (diff) | |
| download | mayu-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.gleam | 17 |
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) |