package main import ( "flag" "fmt" "image" "image/color" "net/http" "strconv" "github.com/gin-gonic/gin" "github.com/makeworld-the-better-one/dither" ) func ditherImage(src image.Image) { } func hw(ctx *gin.Context) { ctx.JSON(http.StatusOK, gin.H{"message": 123}) } func heart(ctx *gin.Context) { ctx.JSON(http.StatusOK, gin.H{"emo": "<3"}) } func main() { port := flag.Int("p", 8080, "port to listen on") flag.Parse() router := gin.Default() palette := []color.Color{color.Black, color.White} ditherer := dither.NewDitherer(palette) ditherer.Matrix = dither.FalseFloydSteinberg router.GET("/", hw) router.GET("/heart", heart) //router.POST("dither",ditherImage()) err := router.Run(":" + strconv.Itoa(*port)) if err != nil { msg := fmt.Errorf("failed to run router: %v", err) fmt.Println(msg) } }