23 lines
525 B
Go
23 lines
525 B
Go
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
|
|
}
|