Initial commit

This commit is contained in:
Arkaprabha Chakraborty
2025-12-01 08:29:49 +05:30
commit 39c61b7790
20 changed files with 4206 additions and 0 deletions

21
cmd/web/hello.go Normal file
View File

@@ -0,0 +1,21 @@
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)
}
}