Skip to content

Commit

Permalink
Update web-framework.md
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei authored Jan 6, 2024
1 parent fbe2ca1 commit 8ed9eea
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/web-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,31 @@ Web Framework

TODO

#### Yap

* https://github.com/goplus/yap (from Dec 2023)
* demo ([blog.go](https://github.com/goplus/yap/blob/main/demo/blog/blog.go))

```go
type article struct {
ID string
}

//go:embed yap
var yapFS embed.FS

fsYap, _ := fs.Sub(yapFS, "yap")
y := yap.New(fsYap)

y.GET("/p/:id", func(ctx *yap.Context) {
ctx.YAP(200, "article", article{
ID: ctx.Param("id"),
})
})

y.Run(":8080")
```

#### Gin

* https://github.com/gin-gonic/gin (73.5k+ stars, from Jun 2014)
Expand Down

0 comments on commit 8ed9eea

Please sign in to comment.