Skip to content

v0.2.0

Compare
Choose a tag to compare
@xushiwei xushiwei released this 06 Jan 14:23
· 286 commits to main since this release
b2406da

features:

  • router (#4)
  • request params (#4)

demo (hello.go):

import "github.com/goplus/yap"

y := yap.New()
y.GET("/p/:id", func(ctx *yap.Context) {
	ctx.JSON(200, yap.H{
		"id": ctx.Param("id"),
	})
})
y.Handle("/", func(ctx *yap.Context) {
	ctx.TEXT(200, "text/html", `<html><body>Hello, <a href="/p/123">Yap</a>!</body></html>`)
})
y.Run(":8080")