|
|
- 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
- }
|