refactor: changed file structure
This commit is contained in:
17
internal/handler/page.go
Normal file
17
internal/handler/page.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
)
|
||||
|
||||
// Handler for static pages. Will render the given templ.Component to the
|
||||
// http.ResponseWriter
|
||||
func HandlePage(Page templ.Component) http.Handler {
|
||||
return http.HandlerFunc(
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
Page.Render(r.Context(), w)
|
||||
},
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user