aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-06-12 03:22:52 -0700
committerFuwn <[email protected]>2024-06-12 03:22:52 -0700
commitbe7e85232ac8db849195b3ad241895d780bbfa47 (patch)
treea56ef938f869721e1e5fb43b6d8b12abd2bc15fc /src
parentbc5d614adb74554255b8cec9787da419a7e0bdb1 (diff)
downloadmayu-be7e85232ac8db849195b3ad241895d780bbfa47.tar.xz
mayu-be7e85232ac8db849195b3ad241895d780bbfa47.zip
feat: simple index page
Diffstat (limited to 'src')
-rw-r--r--src/request.gleam7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/request.gleam b/src/request.gleam
index 5cdc3c4..d9abccf 100644
--- a/src/request.gleam
+++ b/src/request.gleam
@@ -1,6 +1,7 @@
import database
import gleam/json
import gleam/string_builder
+import simplifile
import svg
import wisp
@@ -18,6 +19,12 @@ pub fn handle(request, connection) {
use _ <- middleware(request)
case wisp.path_segments(request) {
+ [] ->
+ case simplifile.read("index.html") {
+ Ok(content) ->
+ wisp.html_response(string_builder.from_string(content), 200)
+ Error(_) -> wisp.not_found()
+ }
["heart-beat"] ->
wisp.html_response(string_builder.from_string("alive"), 200)
["get", "@" <> name] -> {