element/server/router.go
Evan Hazlett a89aa40dda
proxy: start on api and caddy based proxy
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-07-29 22:54:43 -04:00

16 lines
516 B
Go

package server
import "github.com/gorilla/mux"
func (s *Server) router() *mux.Router {
r := mux.NewRouter()
r.HandleFunc("/", s.genericHandler)
r.HandleFunc("/config", s.getConfig).Methods("GET")
r.HandleFunc("/config/raw", s.getConfigRaw).Methods("GET")
r.HandleFunc("/frontends", s.addFrontend).Methods("POST")
r.HandleFunc("/frontends", s.updateFrontend).Methods("PUT")
r.HandleFunc("/frontends/{name}", s.removeFrontend).Methods("DELETE")
r.HandleFunc("/reload", s.reload).Methods("POST")
return r
}