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

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", PetHandlerFindByStatus).Methods("GET")
router.HandleFunc("/pet/{petId}", PetHandlerId).Methods("GET", "POST", "DELETE")
router.HandleFunc("/pet/{petId}/uploadImage", PetHandlerUploadImage).Methods("POST")
router.PathPrefix("/images/").Handler(http.FileServer(http.Dir("./uploads/")))
return router
}