Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #47 from nodes-vapor/feature/routes-in-one-file
Browse files Browse the repository at this point in the history
Move routes to one file
  • Loading branch information
steffendsommer authored Apr 10, 2018
2 parents e237c88 + 4771755 commit f7d470a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Controllers/RouteCollection.stencil
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -15,5 +17,6 @@ extension {{ type.localName }}: RouteCollection {
}
}

// sourcery:end
{% endfor %}

// sourcery:end

0 comments on commit f7d470a

Please sign in to comment.