summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-04-11 08:33:51 -0600
committermo khan <mo@mokhan.ca>2025-04-11 08:33:51 -0600
commitfb4650fc0408c2bb401970d23ac427c936f1c5b8 (patch)
tree40c4a6e3d20da818410adb4fb7058482c0001cd3 /pkg
parentd8fd76b1c0c0bd86b2114dcf6af0b6e34d4783f3 (diff)
chore: serve static files
Diffstat (limited to 'pkg')
-rw-r--r--pkg/web/server.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/web/server.go b/pkg/web/server.go
index 02f3a41..2949309 100644
--- a/pkg/web/server.go
+++ b/pkg/web/server.go
@@ -14,6 +14,7 @@ type Server struct {
}
func NewServer(storage db.Repository) *Server {
+ http.NewServeMux()
return &Server{
db: storage,
fileserver: http.FileServer(http.Dir("public")),
@@ -28,6 +29,8 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", jsonapi.MediaType)
serde.ToJSONAPI(w, s.db.All())
}
+ default:
+ s.fileserver.ServeHTTP(w, r)
break
}
}