#Help with front implementation

11 messages · Page 1 of 1 (latest)

warm sage
#

there are libraries like gomponents and templ that can make it less painful. but at the end of the day ur browser can't run go (unless u compile for wasm) so it'll be kinda weird. go's stdlib has templates that work ok but i think they are pretty ugly. someone else will probably have better advice

forest remnant
warm sage
forest remnant
#

Like would this be valid?
func main() {
mux := http.NewServeMux()

mux.HandleFunc("/login", loginHandler)

http.ListenAndServe(":8080", mux)

}

func loginHandler(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "templates/login.html")
}

warm sage
forest remnant
forest remnant
forest remnant
warm sage
forest remnant
#

Okok thank you!