Compare commits
3 Commits
e0eee1c655
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4d4dcd1bf | ||
|
|
0e871220de | ||
|
|
43322b40d5 |
3
env.sample
Normal file
3
env.sample
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
PROJECT_ID=
|
||||||
|
REGION=us-east4
|
||||||
|
DOMAIN=proto-hype.net
|
||||||
8
main.go
8
main.go
@@ -17,6 +17,14 @@ 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) {
|
||||||
|
log.Printf("Received request from %s, Host: %s", r.RemoteAddr, r.Host)
|
||||||
|
|
||||||
|
// 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