Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
covrom committed Aug 26, 2024
1 parent b587117 commit 6815c5f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# stdchi
Go 1.22+ standard http router wrapper with API like chi router.
Go 1.22+ standard http router wrapper with API like [chi](https://github.com/go-chi/chi) router.
It uses a new syntax for path values ​​within groups and subroutes.

Example:

```go
import chi "github.com/covrom/stdchi"
import "github.com/covrom/stdchi"

// ...

r := NewRouter()
r := stdchi.NewRouter()
r.Use(func(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
fmt.Println("Route /sharing")
Expand Down Expand Up @@ -46,7 +46,7 @@ r.Route("/{hash}/share", func(r Router) {
})
})

m := NewRouter()
m := stdchi.NewRouter()
m.Mount("/sharing", r)
m.Use(func(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit 6815c5f

Please sign in to comment.