evilthings/main.go
Samantha Becker caabd6d740 App stuff
2023-09-18 11:15:19 +02:00

22 lines
337 B
Go

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