penambahan template selanjutnya

This commit is contained in:
2025-07-25 11:00:19 +07:00
parent 6c23369c06
commit 3af7a7ecbb
12 changed files with 63 additions and 73 deletions

View File

@@ -7,9 +7,8 @@ import (
"net/http"
"os/signal"
"syscall"
"time"
"template_blueprint/internal/server"
"time"
)
func gracefulShutdown(apiServer *http.Server, done chan bool) {

View File

@@ -1,21 +1 @@
package web
import (
"log"
"net/http"
)
func HelloWebHandler(w http.ResponseWriter, r *http.Request) {
err := r.ParseForm()
if err != nil {
http.Error(w, "Bad Request", http.StatusBadRequest)
}
name := r.FormValue("name")
component := HelloPost(name)
err = component.Render(r.Context(), w)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
log.Fatalf("Error rendering in HelloWebHandler: %e", err)
}
}