evilthings/main.go

25 lines
352 B
Go
Raw Normal View History

package main
2023-09-18 09:15:19 +00:00
import (
2024-01-08 15:58:43 +00:00
"embed"
2023-09-18 09:15:19 +00:00
"log"
"net/http"
"os"
)
2024-01-08 15:58:43 +00:00
//go:embed templates
var embed_templates embed.FS
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)
if err := http.ListenAndServe(":"+port, nil); err != nil {
log.Fatal(err)
}
}