mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
25 lines
407 B
Go
25 lines
407 B
Go
package git
|
|
|
|
import (
|
|
"errors"
|
|
"net/http"
|
|
|
|
"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)
|
|
default:
|
|
return http.StatusMethodNotAllowed, errors.New("Invalid method.")
|
|
}
|
|
}
|