- Go module initialized with github.com/acty/pirate-station - HTTP server on port 32768 with root and health endpoints - Health check verifies /data volume mount - No external dependencies, stdlib only
28 lines
535 B
Go
28 lines
535 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/acty/pirate-station/internal/health"
|
|
)
|
|
|
|
func main() {
|
|
// Root endpoint
|
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusOK)
|
|
w.Write([]byte("Pirate Station API"))
|
|
})
|
|
|
|
// Health check endpoint
|
|
http.HandleFunc("/health", health.Handler)
|
|
|
|
// Start server on port 32768
|
|
port := ":32768"
|
|
log.Printf("Starting Pirate Station server on port %s", port)
|
|
|
|
if err := http.ListenAndServe(port, nil); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|