wip
This commit is contained in:
3
env.sample
Normal file
3
env.sample
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
PROJECT_ID=
|
||||||
|
REGION=us-east4
|
||||||
|
DOMAIN=proto-hype.net
|
||||||
12
main.go
12
main.go
@@ -17,6 +17,18 @@ func main() {
|
|||||||
rand.Seed(time.Now().UnixNano())
|
rand.Seed(time.Now().UnixNano())
|
||||||
|
|
||||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
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"
|
// Default to 2 words, can be overridden by query param "words"
|
||||||
words := 2
|
words := 2
|
||||||
if wParam := r.URL.Query().Get("words"); wParam != "" {
|
if wParam := r.URL.Query().Get("words"); wParam != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user