From 8aa47b3ccb98b0e09fe3bb9a20a24364ca682d38 Mon Sep 17 00:00:00 2001 From: Kelvin Ly Date: Sun, 14 May 2023 08:18:42 -0400 Subject: [PATCH] Add support for a dev folder --- dev/dev.htm | 15 +++++++++++++++ shroom_server.go | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 dev/dev.htm diff --git a/dev/dev.htm b/dev/dev.htm new file mode 100644 index 0000000..6d889aa --- /dev/null +++ b/dev/dev.htm @@ -0,0 +1,15 @@ + + + + + + + + + + + +
+

Test!

+ + diff --git a/shroom_server.go b/shroom_server.go index c78a07d..bcd64bb 100644 --- a/shroom_server.go +++ b/shroom_server.go @@ -88,11 +88,12 @@ func main() { // TODO } + http.Handle("/d/", http.StripPrefix("/d/", http.FileServer(http.Dir("./dev")))) http.Handle("/", http.FileServer(http.FS(contentSub))) http.HandleFunc("/api/data/week", dumpWeek) http.HandleFunc("/api/data/day", dumpDay) http.HandleFunc("/api/data/hour", dumpHour) - http.HandleFunc("/api/last_point", lastPoint) + http.HandleFunc("/api/latest", lastPoint) http.HandleFunc("/api/status", getStatus) http.HandleFunc("/api/admin", adminHandler)