http middleware handler
go get github.com/yosgo-opensource/http-middleware-go- HttpCORS
Access-Control-Allow-Origin: * [default]
Access-Control-Allow-Headers: Content-Type [default]
- HttpJSONResponse
Content-Type: text/html [GET][default]
Content-Type: application/json [POST][default]
http.Handle("/route",
middleware.HttpCORS(
http.HandlerFunc(watermarkHandler)
)
)http.Handle("/route",
middleware.HttpJSONResponse(
http.HandlerFunc(watermarkHandler)
)
)