~gloatingfiddle/coffeebeans

2a3cbb35b330d0923cd2bce2678d8e8ed3ce0c99 — David Hagerty a month ago 0ea807c main
chore(routing): utilize new routing
1 files changed, 2 insertions(+), 5 deletions(-)

M internal/server/server.go
M internal/server/server.go => internal/server/server.go +2 -5
@@ 11,6 11,7 @@ import (
	"sync"
	"time"

	"git.sr.ht/~gloatingfiddle/coffeebeans/internal/handlers"
	"git.sr.ht/~gloatingfiddle/coffeebeans/internal/version"
)



@@ 30,13 31,9 @@ func Run(ctx context.Context, baseCancel context.CancelFunc, args []string, stdo

	logger.InfoContext(ctx, "starting", slog.Group("environment", slog.Int("port", e.port)))

	mux := http.NewServeMux()
	mux.Handle("/{$}", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		w.Write([]byte("Hello world!"))
	}))
	s := http.Server{
		Addr:    fmt.Sprintf("127.0.0.1:%d", e.port),
		Handler: mux,
		Handler: handlers.SetupRoutes(),
	}
	go func() {
		if err := s.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {