Skip to content

annotation Athena::Routing::Annotations::Route #

Defines an endpoint with an arbitrary HTTP method. Can be used for defining non-standard HTTP method routes.

Fields#

  • path : String - The path for the endpoint, may also be provided as the first positional argument.
  • name : String - The name of the route. Defaults to controller name + method name down snake-cased.
  • method : String - The HTTP method to use for the endpoint.
  • constraints : Hash(String, Regex) - A mapping between a route's path parameters and its constraints.

Example#

@[ARTA::Route("/some/path", method: "TRACE")]
def trace_route : Nil
end