Kemal
Class methods
Prints all registered routes to the specified IO stream.
Displays a formatted table of all routes registered in the application, including HTTP method, path, controller/method name, and authentication/strip status. Routes are sorted by path and method.
Parameters
io: IO - The output stream to write to (default: STDOUT)
Authentication and Stripping Indicators
- 🔒 - Route requires authentication (auth: true)
- ✂️ - Route strips parameters (strip: true or strip: [...])
Example
Kemal.print_routes
# Output:
# GET 🔒 /area51 TestController#area51()
# POST /array_of_named_tuples TestController#array_of_named_tuples(items : Array(NamedTuple(name: String, age: Int32)))
# GET ✂️ /strip TestController#strip(something : String)
#
# 3 routes
Example with Command Line Option
Kemal.config.extra_options do |parser|
parser.on("--routes", "Show all routes") do
Kemal.print_routes
exit(0)
end
end
List of parameter name keywords that trigger automatic redaction in logs.
The following parameters are automatically redacted if a request contains a parameter whose name partially matches one of these keywords (case-sensitive). Use lowercase parameter names to ensure proper redaction.
Default keywords: passw, secret, token, _key, crypt, salt,
certificate, otp, ssn, cvv, cvc
Example
Kemal.redacted_parameters << "api_key"
List of parameter name keywords that trigger automatic redaction in logs.
The following parameters are automatically redacted if a request contains a parameter whose name partially matches one of these keywords (case-sensitive). Use lowercase parameter names to ensure proper redaction.
Default keywords: passw, secret, token, _key, crypt, salt,
certificate, otp, ssn, cvv, cvc
Example
Kemal.redacted_parameters << "api_key"