Added middleware support
This commit is contained in:
parent
1e8a846457
commit
414f7c6b33
9 changed files with 135 additions and 157 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"git.akyoto.dev/go/router/testdata"
|
||||
"git.akyoto.dev/go/server"
|
||||
)
|
||||
|
||||
|
@ -26,7 +27,7 @@ func BenchmarkGitHub(b *testing.B) {
|
|||
response := &NullResponse{}
|
||||
s := server.New()
|
||||
|
||||
for _, route := range loadRoutes("testdata/github.txt") {
|
||||
for _, route := range testdata.Routes("testdata/github.txt") {
|
||||
s.Router.Add(route.Method, route.Path, func(server.Context) error {
|
||||
return nil
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue