simplify some stuff

This commit is contained in:
Henrique Dias
2016-03-12 09:52:04 +00:00
parent 3301b60485
commit d41e4cc047
9 changed files with 33 additions and 54 deletions

View File

@@ -7,11 +7,17 @@ import (
"github.com/hacdias/caddy-hugo/config"
)
var (
conf *config.Config
)
// ServeHTTP is used to serve the content of GIT API.
func ServeHTTP(w http.ResponseWriter, r *http.Request, c *config.Config) (int, error) {
conf = c
switch r.Method {
case "POST":
return POST(w, r, c)
return POST(w, r)
default:
return http.StatusMethodNotAllowed, errors.New("Invalid method.")
}