Param
获取路由的参数。
Example
// curl http://127.0.0.1:3000/users/me
package main
import (
"github.com/vicanso/elton"
"github.com/vicanso/elton/middleware"
)
func main() {
e := elton.New()
e.Use(middleware.NewDefaultResponder())
e.GET("/users/{type}", func(c *elton.Context) (err error) {
c.Body = c.Param("type")
return
})
err := e.ListenAndServe(":3000")
if err != nil {
panic(err)
}
}