Files
go-template-webapp/internal/server/routes.go
2025-07-19 17:54:34 -04:00

25 lines
484 B
Go

package server
import (
"net/http"
)
func (srv *server) routes() http.Handler {
mux := http.NewServeMux()
fileServer := http.FileServer(http.Dir("./ui/static/"))
mux.Handle("GET /static/", http.StripPrefix("/static", fileServer))
//mux.Handle("GET /static/", http.FileServerFS(ui.Files))
//Configure Middleware chains
//Add routes and handlers to map
routes := map[string]http.Handler{}
for path, handler := range routes {
mux.Handle(path, handler)
}
return mux
}