Skip to content

Commit 9f43331

Browse files
committed
add route groups in doc
1 parent c04ec74 commit 9f43331

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
## Features
1212

1313
- Routing
14+
- Route groups
1415
- Static files
1516
- Simple and elegant API
1617
- Middleware support
@@ -92,6 +93,37 @@ func main() {
9293
}
9394
```
9495

96+
- Route groups
97+
98+
Supports `GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD, CONNECT, TRACE`
99+
100+
```go
101+
package main
102+
103+
import (
104+
"github.com/gopulse/pulse"
105+
)
106+
107+
func main() {
108+
app := pulse.New()
109+
router := pulse.NewRouter()
110+
api := &pulse.Group{
111+
prefix: "/api",
112+
router: router,
113+
}
114+
115+
v1 := api.Group("/v1")
116+
v1.GET("/users", func(ctx *Context) error {
117+
ctx.String("users")
118+
return nil
119+
})
120+
121+
app.Router = router
122+
123+
app.Run(":3000")
124+
}
125+
```
126+
95127
* Static files
96128

97129
```go

0 commit comments

Comments
 (0)