Skip to content

Commit

Permalink
update web generator
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmueller committed Apr 17, 2023
1 parent 6220ce9 commit 4a6a483
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions framework/web/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (l *loader) Load() (state *State, err error) {
// Add initial imports
l.imports.AddStd("net/http", "context")
l.imports.AddNamed("middleware", "github.com/livebud/bud/package/middleware")
l.imports.AddNamed("methodoverride", "github.com/livebud/bud/package/middleware/methodoverride")
l.imports.AddNamed("webrt", "github.com/livebud/bud/framework/web/webrt")
l.imports.AddNamed("router", "github.com/livebud/bud/package/router")
// Show the welcome page if we don't have any web resources
Expand Down
9 changes: 4 additions & 5 deletions framework/web/web.gotext
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ func New(
{{- end }}
{{- end }}
// Compose the middleware together
middleware := middleware.Compose(
middleware.MethodOverride(),
router,
stack := middleware.Compose(
methodoverride.New(),
)
// 404 at the bottom of the middleware
handler := middleware.Middleware(http.NotFoundHandler())
// Add the router to the bottom of the middleware
handler := stack(router)
// Return the web server
return &Server{handler}
}
Expand Down

0 comments on commit 4a6a483

Please sign in to comment.