actually serve public

This commit is contained in:
Branden J Brown 2024-02-02 12:57:18 -06:00
parent 8eabde60fd
commit 438c70b41b
1 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package main
import ( import (
"context" "context"
"log/slog"
"net/http" "net/http"
"os" "os"
@ -46,6 +47,7 @@ func main() {
r.Post("/user/login", s.Login) r.Post("/user/login", s.Login)
r.With(serve.WithSession(sessions)).Get("/user/me", s.Me) r.With(serve.WithSession(sessions)).Get("/user/me", s.Me)
r.With(serve.WithSession(sessions)).Get("/queue", s.Queue) r.With(serve.WithSession(sessions)).Get("/queue", s.Queue)
r.Method("GET", "/", http.FileServer(http.Dir(public))) r.Method("GET", "/*", http.FileServer(http.Dir(public)))
slog.Info("listening", "addr", addr, "public", public)
http.ListenAndServe(addr, r) http.ListenAndServe(addr, r)
} }