router is missing at /article/100

#6 · open · 1 comments

View on GitHub ↗

tablecell

``` package main import "github.com/fuxiaohei/GoInk" func main() { app := GoInk.New() app.Get("/", func(ctx *GoInk.Context){ ctx.Body = []byte("Hello GoInk !") }) app.Get("/article/:id",func(ctx *GoInk.Context){ //println(ctx.Param("id") ctx.Body = []byte( ctx.Param("id")) }) app.Run() } ``` visit http://localhost:9001/article/100 console log router is missing at /article/100

Comments

tablecell

router is missing at /add ``` package main import ( "github.com/fuxiaohei/GoInk" "fmt" ) func main() { app := GoInk.New() app.Post("/add",func(ctx *GoInk.Context){ fmt.Println(ctx.Request) ctx.Body = []byte("add GoInk !") }) app.Run() } ``` curl -X POST http://localhost:9001/add -H "Content-Type: application/json" -d @data.json