Skip to content

Commit ac7d1cb

Browse files
committed
πŸ“š Add notes about interoperability.
1 parent ea0dedc commit ac7d1cb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,24 @@ app.register {
153153
}
154154
```
155155

156+
### Interoperability
157+
158+
For existing vapor applications, it may be unreasonable or unwieldly to rewrite your entire routing stack in one go. You can start with replacing smaller sections of your route definitions by registering a `RouteComponent` on any `RoutesBuilder` in your application.
159+
160+
161+
```swift
162+
let users = app.grouped("users")
163+
users.get(":user") { ... }
164+
users.get("popular") { ... }
165+
...
166+
167+
let books = app.grouped("books")
168+
books.register {
169+
GET("latest") { ... }
170+
GET("trending") { ... }
171+
}
172+
```
173+
156174
### RouteModifiers
157175

158176
- Currently undocumented.

0 commit comments

Comments
Β (0)