Add new debug option for http
This commit is contained in:
parent
0ba34fe80f
commit
0290a42d07
39 changed files with 293 additions and 189 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
"net/http"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/server/handling"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/server/list"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/server/templating"
|
||||
)
|
||||
|
|
@ -15,6 +16,7 @@ type Home struct {
|
|||
dependencies struct {
|
||||
ListInstances *list.ListInstances
|
||||
Templating *templating.Templating
|
||||
Handling *handling.Handling
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ func (home *Home) publicHandler(ctx context.Context) http.Handler {
|
|||
|
||||
about := home.dependencies.Templating.GetCustomizable(aboutTemplate)
|
||||
|
||||
return tpl.HTMLHandler(func(r *http.Request) (pc publicContext, err error) {
|
||||
return tpl.HTMLHandler(home.dependencies.Handling, func(r *http.Request) (pc publicContext, err error) {
|
||||
// only act on the root path!
|
||||
if strings.TrimSuffix(r.URL.Path, "/") != "" {
|
||||
return pc, httpx.ErrNotFound
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue