From 8b3d93fb01ea63b8daf77861fef1be837276652a Mon Sep 17 00:00:00 2001 From: demo Date: Thu, 7 May 2026 13:51:29 -0400 Subject: refactor: move type defs and ServeHTTP def to internal package --- internal/types/types.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 internal/types/types.go (limited to 'internal') diff --git a/internal/types/types.go b/internal/types/types.go new file mode 100644 index 0000000..0800994 --- /dev/null +++ b/internal/types/types.go @@ -0,0 +1,27 @@ +package types + +import ( + "io" + "net/http" +) + +type option struct { + Text string + Arc string +} + +type arc struct { + Title string + Story []string + Options []option +} + +type Story map[string]arc + +func (s Story) ServeHTTP(w http.ResponseWriter, r *http.Request) { + arc := r.PathValue("arc") + title := s[arc].Title + + w.Header().Set("Content-Type", "text/plain") + io.WriteString(w, title) +} -- cgit v1.2.3