Use github.com/julienschmidt/httprouter instead of gorilla
This commit is contained in:
parent
5a0b81ba32
commit
3b320469b5
13 changed files with 223 additions and 169 deletions
|
|
@ -2,13 +2,15 @@ package api
|
|||
|
||||
import (
|
||||
"srs.epita.fr/fic-server/libfic"
|
||||
|
||||
"github.com/julienschmidt/httprouter"
|
||||
)
|
||||
|
||||
func init() {
|
||||
router.Path("/events/").Methods("GET").HandlerFunc(apiHandler(getEvents))
|
||||
router.GET("/api/events/", apiHandler(getEvents))
|
||||
}
|
||||
|
||||
func getEvents(args map[string]string, body []byte) (interface{}, error) {
|
||||
func getEvents(_ httprouter.Params, _ []byte) (interface{}, error) {
|
||||
if evts, err := fic.GetEvents(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
|
|
|
|||
Reference in a new issue