Skip to content

Commit

Permalink
chore: add pathprefix to enable dynamic paths for echo
Browse files Browse the repository at this point in the history
  • Loading branch information
jjchambl committed Jun 8, 2023
1 parent 3ef0b4c commit 7280e43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ func (s *Server) registerHandlers() {
s.router.HandleFunc("/", s.indexHandler).HeadersRegexp("User-Agent", "^Mozilla.*").Methods("GET")
s.router.HandleFunc("/", s.infoHandler).Methods("GET")
s.router.HandleFunc("/version", s.versionHandler).Methods("GET")
s.router.HandleFunc("/echo", s.echoHandler).Methods("POST,PUT")
s.router.HandleFunc("/echo/{echo:.*}", s.echoHandler).Methods("POST,PUT")
s.router.HandleFunc("/echo", s.echoHandler)
s.router.PathPrefix("/echo/").HandlerFunc(s.echoHandler)
s.router.HandleFunc("/env", s.envHandler).Methods("GET", "POST")
s.router.HandleFunc("/headers", s.echoHeadersHandler).Methods("GET", "POST")
s.router.HandleFunc("/delay/{wait:[0-9]+}", s.delayHandler).Methods("GET").Name("delay")
Expand All @@ -120,8 +120,8 @@ func (s *Server) registerHandlers() {
s.router.HandleFunc("/token", s.tokenGenerateHandler).Methods("POST")
s.router.HandleFunc("/token/validate", s.tokenValidateHandler).Methods("GET")
s.router.HandleFunc("/api/info", s.infoHandler).Methods("GET")
s.router.HandleFunc("/api/echo", s.echoHandler).Methods("POST,PUT")
s.router.HandleFunc("/api/echo{echo:.*}", s.echoHandler).Methods("POST,PUT")
s.router.HandleFunc("/api/echo", s.echoHandler)
s.router.PathPrefix("/api/echo/").HandlerFunc(s.echoHandler)
s.router.HandleFunc("/ws/echo", s.echoWsHandler)
s.router.HandleFunc("/chunked", s.chunkedHandler)
s.router.HandleFunc("/chunked/{wait:[0-9]+}", s.chunkedHandler)
Expand Down

0 comments on commit 7280e43

Please sign in to comment.