Use github.com/julienschmidt/httprouter instead of gorilla
This commit is contained in:
parent
5a0b81ba32
commit
3b320469b5
13 changed files with 226 additions and 172 deletions
|
@ -1,11 +1,13 @@
|
|||
package api
|
||||
|
||||
import ()
|
||||
import (
|
||||
"github.com/julienschmidt/httprouter"
|
||||
)
|
||||
|
||||
func init() {
|
||||
router.Path("/version").Methods("GET").HandlerFunc(apiHandler(showVersion))
|
||||
router.GET("/api/version", apiHandler(showVersion))
|
||||
}
|
||||
|
||||
func showVersion(args map[string]string, body []byte) (interface{}, error) {
|
||||
func showVersion(_ httprouter.Params, body []byte) (interface{}, error) {
|
||||
return map[string]interface{}{"version": 0.1}, nil
|
||||
}
|
||||
|
|
Reference in a new issue