I want to inspect a list of all routes, that Vapor app is serving. Is there a script or a run-time command that will generate the list for me?
I'm looking for something similar to rake routes
in Ruby on Rails
Run vapor run routes
from the command line after executing vapor build
Another alternative to get the routes use the following command. It will build your project and displays all routes registered to the Application
's Router
in an ASCII-formatted table.
$ swift run Run routes
+------+------------------+
| GET | /search |
+------+------------------+
| GET | /hash/:string |
+------+------------------+
A colon preceding a path component indicates a variable parameter. A colon with no text following is a parameter whose result will be discarded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With