diff --git a/main.go b/main.go index f3c241d..e567461 100644 --- a/main.go +++ b/main.go @@ -12,6 +12,7 @@ import ( type StaticThingy struct { Port string + HCaptchaSiteKey string } var port string @@ -22,6 +23,7 @@ func main() { otherthings.CheckEnv() log.Println("[HTTP] Starting server") port := os.Getenv("SEGFAUTILITIES_PORT") + hcaptcha_site_key := os.Getenv("SEGFAUTILITIES_PORT") tmpl := template.Must(template.ParseFiles("static/index.html")) http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { data := StaticThingy{ @@ -29,6 +31,16 @@ func main() { } tmpl.Execute(w, data) }) + + tmpl_form := template.Must(template.ParseFiles("static/form.html")) + http.HandleFunc("/form/", func(w http.ResponseWriter, r *http.Request) { + data := StaticThingy{ + Port: port, + HCaptchaSiteKey: hcaptcha_site_key, + } + tmpl_form.Execute(w, data) + }) + http.HandleFunc("/api/", func(w http.ResponseWriter, r *http.Request) { io.WriteString(w, "welcome to hell") }) diff --git a/static/form.html b/static/form.html new file mode 100644 index 0000000..ca18499 --- /dev/null +++ b/static/form.html @@ -0,0 +1,57 @@ + + + + + + + Segfautilites form implementation example + + + + +
+
+ + +
+ +
+ +
+ + \ No newline at end of file diff --git a/static/index.html b/static/index.html index e03bc57..c24a09b 100644 --- a/static/index.html +++ b/static/index.html @@ -1,5 +1,9 @@ + + + + Segfautilites