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.

25 lines
611 B

3 years ago
  1. package api
  2. import (
  3. "net/http"
  4. "github.com/gorilla/mux"
  5. )
  6. func InitApiEndpoints() *mux.Router {
  7. var (
  8. router *mux.Router
  9. )
  10. router = mux.NewRouter()
  11. // Define routes for pet api
  12. router.HandleFunc("/pet", PetHandlerCreateUpdate).Methods("POST", "PUT")
  13. router.HandleFunc("/pet/findByStatus", PetHandlerFindByStatus).Methods("GET")
  14. router.HandleFunc("/pet/{petId}", PetHandlerId).Methods("GET", "POST", "DELETE")
  15. router.HandleFunc("/pet/{petId}/uploadImage", PetHandlerUploadImage).Methods("POST")
  16. router.PathPrefix("/images/").Handler(http.FileServer(http.Dir("./uploads/")))
  17. return router
  18. }