evilthings/main.go

23 lines
337 B
Go
Raw Normal View History

package main
2023-09-18 09:15:19 +00:00
import (
"log"
"net/http"
"os"
)
func main() {
2023-09-18 09:15:19 +00:00
port := os.Getenv("PORT")
if port == "" {
port = "8080"
log.Printf("Defaulting to port %s \n", port)
}
2023-09-18 09:15:19 +00:00
http.HandleFunc("/", handleRoot)
http.HandleFunc("/clicked", handleClicked)
if err := http.ListenAndServe(":"+port, nil); err != nil {
log.Fatal(err)
}
}