first commit
This commit is contained in:
@@ -2,6 +2,7 @@ package rest
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gorilla/handlers"
|
||||
"github.com/gorilla/mux"
|
||||
"nbarest/lib/persistence"
|
||||
"net/http"
|
||||
@@ -16,6 +17,7 @@ func ServeAPI(endpoint string,dbhandler persistence.DatabaseHandler) error{
|
||||
playersrouter.Path("/").HandlerFunc(handler.FindAllPlayerHandler).Methods("GET")
|
||||
playersrouter.Path("/").HandlerFunc(handler.NewPlayerHandler).Methods("POST")
|
||||
fmt.Println("listen")
|
||||
return http.ListenAndServe(endpoint,r)
|
||||
server := handlers.CORS()(r)
|
||||
return http.ListenAndServe(endpoint, server)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user