hydra-webauthn/internal/route/mount.go

23 lines
525 B
Go
Raw Permalink Normal View History

2023-11-15 20:38:25 +01:00
package route
import (
"forge.cadoles.com/wpetit/hydra-webauthn/internal/config"
"forge.cadoles.com/wpetit/hydra-webauthn/internal/route/api"
"forge.cadoles.com/wpetit/hydra-webauthn/internal/route/hydra"
"github.com/go-chi/chi"
"gitlab.com/wpetit/goweb/static"
)
func Mount(r *chi.Mux, config *config.Config) error {
r.Get("/", serveHomePage)
hydra.Mount(r, config)
api.Mount(r, config)
notFoundHandler := r.NotFoundHandler()
r.Get("/*", static.Dir(config.HTTP.PublicDir, "", notFoundHandler))
return nil
}