This commit is contained in:
Jason Swank
2026-05-17 21:58:45 -04:00
parent e0eee1c655
commit 43322b40d5
2 changed files with 15 additions and 0 deletions

3
env.sample Normal file
View File

@@ -0,0 +1,3 @@
PROJECT_ID=
REGION=us-east4
DOMAIN=proto-hype.net

12
main.go
View File

@@ -17,6 +17,18 @@ func main() {
rand.Seed(time.Now().UnixNano())
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
// error handling for common probes
if r.Host == "" {
http.BadRequest(w, r)
return
}
// error handling for common probes
if r.URL.Path != "/" {
http.NotFound(w, r)
return
}
// Default to 2 words, can be overridden by query param "words"
words := 2
if wParam := r.URL.Query().Get("words"); wParam != "" {