fixes
This commit is contained in:
parent
9b956bd505
commit
4f526f4dbd
3
main.go
3
main.go
@ -12,6 +12,7 @@ import (
|
|||||||
|
|
||||||
type StaticThingy struct {
|
type StaticThingy struct {
|
||||||
Port string
|
Port string
|
||||||
|
HCaptchaSiteKey string
|
||||||
}
|
}
|
||||||
|
|
||||||
var port string
|
var port string
|
||||||
@ -22,6 +23,7 @@ func main() {
|
|||||||
otherthings.CheckEnv()
|
otherthings.CheckEnv()
|
||||||
log.Println("[HTTP] Starting server")
|
log.Println("[HTTP] Starting server")
|
||||||
port := os.Getenv("SEGFAUTILITIES_PORT")
|
port := os.Getenv("SEGFAUTILITIES_PORT")
|
||||||
|
hcaptcha_site_key := os.Getenv("SEGFAUTILITIES_PORT")
|
||||||
tmpl := template.Must(template.ParseFiles("static/index.html"))
|
tmpl := template.Must(template.ParseFiles("static/index.html"))
|
||||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
data := StaticThingy{
|
data := StaticThingy{
|
||||||
@ -34,6 +36,7 @@ func main() {
|
|||||||
http.HandleFunc("/form/", func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/form/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
data := StaticThingy{
|
data := StaticThingy{
|
||||||
Port: port,
|
Port: port,
|
||||||
|
HCaptchaSiteKey: hcaptcha_site_key,
|
||||||
}
|
}
|
||||||
tmpl_form.Execute(w, data)
|
tmpl_form.Execute(w, data)
|
||||||
})
|
})
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form
|
<form
|
||||||
action="https://localhost:{{.Port}}/api/form"
|
action="/api/form"
|
||||||
method="POST"
|
method="POST"
|
||||||
>
|
>
|
||||||
<div class="meta">
|
<div class="meta">
|
||||||
@ -50,7 +50,7 @@
|
|||||||
required
|
required
|
||||||
placeholder="Your message"
|
placeholder="Your message"
|
||||||
></textarea>
|
></textarea>
|
||||||
<div class="h-captcha" data-sitekey=""></div>
|
<div class="h-captcha" data-sitekey="{{.HCaptchaSiteKey}}"></div>
|
||||||
<input type="submit" value="Submit" />
|
<input type="submit" value="Submit" />
|
||||||
</form>
|
</form>
|
||||||
</body>
|
</body>
|
||||||
|
Reference in New Issue
Block a user