Skip to content

yosgo-opensource/http-middleware-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP(s) middleware go

http middleware handler

Install

go get github.com/yosgo-opensource/http-middleware-go

Method

  • 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]

Useage

HttpCORS

http.Handle("/route",
  middleware.HttpCORS(
    http.HandlerFunc(watermarkHandler)
  )
)

HttpJSONReqponse

http.Handle("/route",
  middleware.HttpJSONResponse(
    http.HandlerFunc(watermarkHandler)
  )
)

About

go http(s) middleware stuff

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages