diff options
| author | mo khan <mo@mokhan.ca> | 2025-04-11 08:33:51 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-04-11 08:33:51 -0600 |
| commit | fb4650fc0408c2bb401970d23ac427c936f1c5b8 (patch) | |
| tree | 40c4a6e3d20da818410adb4fb7058482c0001cd3 /pkg/web | |
| parent | d8fd76b1c0c0bd86b2114dcf6af0b6e34d4783f3 (diff) | |
chore: serve static files
Diffstat (limited to 'pkg/web')
| -rw-r--r-- | pkg/web/server.go | 3 |
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 } } |
