You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
381B

  1. package hdx
  2. import (
  3. "net/http"
  4. )
  5. var prefix map[string]string
  6. func addRoutes(sm *http.ServeMux, server *Server, staticFiles string) {
  7. prefix = map[string]string{
  8. "info": "/info/",
  9. "health": "/healthz",
  10. "visit": "/",
  11. }
  12. sm.HandleFunc(prefix["visit"], server.visit)
  13. sm.HandleFunc(prefix["info"], server.serverInfo)
  14. sm.HandleFunc(prefix["health"], server.health)
  15. }