package main

import (
	"log"
	"net/http"
)

type imageTransform struct {
	image.Image
	TransformFunc func(image.Image) image.Image
}

type BlankFill struct {
}

func (t imageTransform) ServeHTTP(w http.ResponseWriter, r *http.Request) {

}

func indexHTML(w http.ResponseWriter, r *http.Request) {
	f, err := os.Open("")
	if err != nil {
		w.WriteHeader(http.StatusInternalServerError)
		log.Fatalln("error opening file:", err)
		return
	}
	_, err := io.Copy(w, f)
	if err != nil {
		w.WriteHeader(http.StatusInternalServerError)
		log.Println("copy error:", err)
		return
	}
}

func main() {
	http.HandleFunc("/", indexHTML)
	http.Handle("POST /upload", imageTransform)

	err := http.ListenAndServe(":8080", nil)
	if err != nil {
		log.Panicln(err)
	}
}
