Vapor Documentation Beta

Class Routes​Command

public final class RoutesCommand: Command

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.

The path will be displayed with the same syntax that is used to register a route.

%3 RoutesCommand RoutesCommand Command Command RoutesCommand->Command

Nested Types

RoutesCommand.Signature

Conforms To

Command

Properties

help

var help: String

Methods

run(using:​signature:​)

public func run(using context: CommandContext, signature: Signature) throws