SUrvey now works

This commit is contained in:
2024-11-17 19:41:30 +01:00
parent 51b0641702
commit e75de81e39
13 changed files with 1210 additions and 201 deletions

View File

@@ -41,13 +41,15 @@ func handlePost(w http.ResponseWriter, r *http.Request) {
handleGet(w, r)
}
http.Redirect(w, r, "/thankyou", http.StatusSeeOther)
}
func handleGet(w http.ResponseWriter, r *http.Request) {
lp := filepath.Join("application", "layouts", "main.html")
fp := filepath.Join("application", "views", "signup.html")
log.Println("Hitting Signup")
// add a CSP header to allow only same-origin scripts
w.Header().Set("Content-Security-Policy", "script-src 'unsafe-eval' 'self'")
// Return a 404 if the template doesn't exist
info, err := os.Stat(fp)