#109 move last url to new layout
Some checks failed
Build Docker Image / Explore-Gitea-Actions (push) Failing after 7s
Some checks failed
Build Docker Image / Explore-Gitea-Actions (push) Failing after 7s
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/a-h/templ"
|
||||
)
|
||||
|
||||
func HandleStaticUi(w http.ResponseWriter, r *http.Request) {
|
||||
func HandleIndexAnd404(w http.ResponseWriter, r *http.Request) {
|
||||
var comp templ.Component = nil
|
||||
if r.URL.Path != "/" {
|
||||
comp = templates.Layout(templates.NotFound())
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"me-fit/templates"
|
||||
"me-fit/utils"
|
||||
|
||||
"database/sql"
|
||||
@@ -22,6 +23,13 @@ var (
|
||||
)
|
||||
)
|
||||
|
||||
func App(w http.ResponseWriter, r *http.Request) {
|
||||
comp := templates.App()
|
||||
layout := templates.Layout(comp)
|
||||
layout.Render(r.Context(), w)
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
func NewWorkout(db *sql.DB) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
metrics.WithLabelValues("new").Inc()
|
||||
|
||||
Reference in New Issue
Block a user