fixes
This commit is contained in:
parent
9b956bd505
commit
4f526f4dbd
3
main.go
3
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{
|
||||
@ -34,6 +36,7 @@ func main() {
|
||||
http.HandleFunc("/form/", func(w http.ResponseWriter, r *http.Request) {
|
||||
data := StaticThingy{
|
||||
Port: port,
|
||||
HCaptchaSiteKey: hcaptcha_site_key,
|
||||
}
|
||||
tmpl_form.Execute(w, data)
|
||||
})
|
||||
|
@ -24,7 +24,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<form
|
||||
action="https://localhost:{{.Port}}/api/form"
|
||||
action="/api/form"
|
||||
method="POST"
|
||||
>
|
||||
<div class="meta">
|
||||
@ -50,7 +50,7 @@
|
||||
required
|
||||
placeholder="Your message"
|
||||
></textarea>
|
||||
<div class="h-captcha" data-sitekey=""></div>
|
||||
<div class="h-captcha" data-sitekey="{{.HCaptchaSiteKey}}"></div>
|
||||
<input type="submit" value="Submit" />
|
||||
</form>
|
||||
</body>
|
||||
|
Reference in New Issue
Block a user