element/server/router.go
Evan Hazlett 2eba8d6511
wip: grpc api
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-08-14 08:39:37 -04:00

18 lines
556 B
Go

package server
import "github.com/gorilla/mux"
func (s *Server) router() *mux.Router {
r := mux.NewRouter()
// generic
r.HandleFunc("/", s.genericHandler)
// proxy
r.HandleFunc("/config", s.apiGetConfig).Methods("GET")
r.HandleFunc("/config/raw", s.apiGetConfigRaw).Methods("GET")
r.HandleFunc("/frontends", s.apiAddFrontend).Methods("POST")
r.HandleFunc("/frontends", s.apiUpdateFrontend).Methods("PUT")
r.HandleFunc("/frontends/{name}", s.apiRemoveFrontend).Methods("DELETE")
r.HandleFunc("/reload", s.apiReload).Methods("POST")
return r
}