Files
yoink-go/cli/healthcheck.go
Bryan Bailey 25eee6f76a feat(web): add dockerized web UI with comic library browser
Adds a `yoink serve` command that starts an HTTP server with a
Sonarr/MeTube-inspired dark UI. Features a URL input bar for
triggering downloads, a 150x300 cover grid with filter and sort
controls, a live download queue strip, and toast notifications.

Includes Dockerfile (multi-stage, distroless runtime) and
docker-compose.yml for easy deployment.
2026-03-08 22:02:38 -04:00

29 lines
631 B
Go

package cli
import (
"fmt"
"net/http"
"os"
"github.com/spf13/cobra"
)
var healthcheckCmd = &cobra.Command{
Use: "healthcheck",
Short: "Check if the web server is running (used by Docker HEALTHCHECK)",
Args: cobra.NoArgs,
Hidden: true,
Run: func(cmd *cobra.Command, args []string) {
port, _ := cmd.Flags().GetString("port")
resp, err := http.Get(fmt.Sprintf("http://localhost:%s/health", port))
if err != nil || resp.StatusCode != http.StatusOK {
os.Exit(1)
}
},
}
func init() {
healthcheckCmd.Flags().StringP("port", "p", "8080", "Port the server is listening on")
cli.AddCommand(healthcheckCmd)
}