From 4771755c74c14e8377d1588f0b750e091be19580 Mon Sep 17 00:00:00 2001 From: "Steffen D. Sommer" Date: Mon, 9 Apr 2018 18:04:31 +0200 Subject: [PATCH] Move routes to one file --- Controllers/RouteCollection.stencil | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Controllers/RouteCollection.stencil b/Controllers/RouteCollection.stencil index 4f8ccfe..69acb5b 100644 --- a/Controllers/RouteCollection.stencil +++ b/Controllers/RouteCollection.stencil @@ -1,9 +1,11 @@ -{# One route file per model #} +{# One file with all routes #} -{% for type in types.all|!protocol|annotated:"controller" %} -// sourcery:file:Routes/{{ type.localName }}/{{ type.localName }}+RouteCollection.generated.swift +// sourcery:file:Routes.generated.swift import Vapor +{% for type in types.all|!protocol|annotated:"controller" %} +// MARK: {{ type.localName }} routes + extension {{ type.localName }}: RouteCollection { {{ type.accessLevel }} func build(_ builder: RouteBuilder) throws { builder.group("{{ type.annotations.group }}") { routes in @@ -15,5 +17,6 @@ extension {{ type.localName }}: RouteCollection { } } -// sourcery:end {% endfor %} + +// sourcery:end \ No newline at end of file