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.

27 lines
756 B

package api
import (
"net/http"
"github.com/gorilla/mux"
)
func InitApiEndpoints() *mux.Router {
var (
router *mux.Router
)
router = mux.NewRouter()
// Define routes for pet api
router.HandleFunc("/pet", PetHandlerCreateUpdate).Methods("POST", "PUT")
router.HandleFunc("/pet/findByStatus", FindByStatusPetHandler).Methods("GET")
router.HandleFunc("/pet/{petId}", GetPetHandler).Methods("GET")
router.HandleFunc("/pet/{petId}", UpdatePetHandler).Methods("POST")
router.HandleFunc("/pet/{petId}", DeletePetHandler).Methods("DELETE")
router.HandleFunc("/pet/{petId}/uploadImage", UploadImagePetHandler).Methods("POST")
router.PathPrefix("/").Handler(http.StripPrefix("/images/", http.FileServer(http.Dir("./uploads"))))
return router
}