From 30165f4c8522a50b08864e46f07fae4cbecf3886 Mon Sep 17 00:00:00 2001 From: Reindert Vetter Date: Sun, 24 May 2020 19:57:45 +0200 Subject: [PATCH] Lanvard#48 add decorators for routes --- app/providers/route_service_provider.go | 6 ++++++ test/helper.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/providers/route_service_provider.go b/app/providers/route_service_provider.go index 650c835..02e6c80 100644 --- a/app/providers/route_service_provider.go +++ b/app/providers/route_service_provider.go @@ -16,6 +16,12 @@ func (p RouteServiceProvider) Boot(app inter.App) inter.App { collection.Merge(routes.Api) collection.Merge(routes.Web) + // collection.WhereMulti(map[string]string{ + // "id": "[0-9]+", + // }) + + routing.DecorateRoutes(collection) + app.Singleton("routes", collection) return app diff --git a/test/helper.go b/test/helper.go index 279b7f9..c277f6c 100644 --- a/test/helper.go +++ b/test/helper.go @@ -11,7 +11,7 @@ import ( func ResponseByRequest(request inter.Request) inter.Response { app := request.App() - if nil == request.App() { + if request.App() == nil { app = bootstrap.NewAppFromBoot() }