Skip to content

Commit

Permalink
moved
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <github@ysh.us>
  • Loading branch information
yurishkuro committed Sep 4, 2023
1 parent 9a4f2cb commit 8159224
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/hotrod/services/route/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,15 @@ func (s *Server) Run() error {
func (s *Server) createServeMux() http.Handler {
mux := tracing.NewServeMux(false, s.tracer, s.logger)
mux.Handle("/route", http.HandlerFunc(s.route))
mux.Handle("/debug/vars", http.HandlerFunc(movedToFrontend))
mux.Handle("/metrics", http.HandlerFunc(movedToFrontend))
return mux
}

func movedToFrontend(w http.ResponseWriter, r *http.Request) {
http.Error(w, "endpoint moved to the frontend service", http.StatusNotFound)
}

func (s *Server) route(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
s.logger.For(ctx).Info("HTTP request received", zap.String("method", r.Method), zap.Stringer("url", r.URL))
Expand Down

0 comments on commit 8159224

Please sign in to comment.