Added middleware support

This commit is contained in:
2024-03-13 20:18:01 +01:00
parent 1bcf4794f5
commit e69a66aa31
9 changed files with 135 additions and 157 deletions

View File

@ -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
})