Skip to content

Commit

Permalink
#49 match host in routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Reindert Vetter committed Jun 6, 2020
1 parent e4ee9ab commit db2ed19
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/http/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ func NewKernel(app inter.App) http.Kernel {
}
}

func pipes() []inter.Pipe {
return []inter.Pipe{
func pipes() []inter.HttpMiddleware {
return []inter.HttpMiddleware{
// todo remove or use ValidatePostSize
middleware.ValidatePostSize{},
}
Expand Down
9 changes: 2 additions & 7 deletions app/http/middleware/validate_post_size.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
package middleware

import (
"github.com/lanvard/contract/inter"
"github.com/lanvard/foundation"
)
import "github.com/lanvard/contract/inter"

type ValidatePostSize struct {
App foundation.Application
}
type ValidatePostSize struct{}

func (v ValidatePostSize) Handle(request inter.Request, next inter.MiddlewareDestination) inter.Response {
// todo validate
Expand Down
1 change: 0 additions & 1 deletion src/adapters/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ var User = struct {
}{
AllByRequest: func(request inter.Request) ([]contract.User, error) {
var err error

var users []contract.User

users = append(users, model.NewUser(5435, "[email protected]"))
Expand Down
4 changes: 2 additions & 2 deletions test/user_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func Test_get_all_users(t *testing.T) {
request := http.NewRequest(http.Options{
Method: method.Get,
Url: "/api/users",
Uri: "/api/users",
})

ResponseByRequest(request)
Expand All @@ -22,7 +22,7 @@ func Test_get_all_users(t *testing.T) {
func Test_get_user_by_id(t *testing.T) {
request := http.NewRequest(http.Options{
Method: method.Get,
Url: "/api/user/64564",
Uri: "/api/user/64564",
})

result := ResponseByRequest(request)
Expand Down

0 comments on commit db2ed19

Please sign in to comment.