Configuration
Configuration
addFormat()— Adds a new MIME type to your Wheels application for use with responding to multiple formats.api()— Scope routes under an API path prefix. Shorthand for.group(path=“api”, name=“api”, …). Typically used incollection()— A collection route doesn’t require an id because it acts on a collection of objects.constraints()— Set variable patterns to use for matching.controller()— Considered deprecated as this doesn’t conform to RESTful routing principles; Try not to use this.delete()— Create a route that matches a URL requiring an HTTPDELETEmethod. We recommend using this matcher to exposend()— Call this to end a nested routing block or the entire route configuration. This method is chained on a sequence of routienv()— Returns the value of an environment variable. Checks application.env (loaded from .env files) first, then falls back toget()— Returns the current setting for the supplied Wheels setting or the current default for the supplied Wheels function arguget()— Create a route that matches a URL requiring an HTTPGETmethod. We recommend only using this matcher to expgroup()— Group routes together with shared attributes like path prefix, name prefix, and constraints without implying a controllehealth()— Register a health check route at/health(or a custom path). Returns a JSON response with status and timestmapper()— Returns the mapper object used to configure your application’s routes. Usually you will use this method inconfig/member()— Scope routes within a nested resource which require use of the primary key as part of the URL pattern;namespace()— Scopes any the controllers for any routes configured within this block to a subfolder (package) and also adds the packagpackage()— Scopes any the controllers for any routes configured within this block to a subfolder (package) without adding the packapatch()— Create a route that matches a URL requiring an HTTPPATCHmethod. We recommend using this matcher to exposepost()— Create a route that matches a URL requiring an HTTPPOSTmethod. We recommend using this matcher to exposeput()— Create a route that matches a URL requiring an HTTPPUTmethod. We recommend using this matcher to expose aregisterOnError()— Registers a callback function to be invoked when an unhandled error occurs.resource()— Create a group of routes that exposes actions for manipulating a singular resource. A singular resource exposes URL pattresources()— Create a group of routes that exposes actions for manipulating a collection of resources. A plural resource exposes URLroot()— Create a route that matches the root of its current context. This mapper can be used for the application’s web root (orscope()— Set any number of parameters to be inherited by mappers called within this matcher’s block. For example, set a package oset()— Use to configure a global setting or set a default for a function.switchTenant()— Switches the active tenant mid-request. Throws if the current tenant is lockedtenant()— Returns the current tenant struct, or an empty struct if no tenant is active.version()— Scope routes under a version prefix within an API group. Creates a URL path prefix ofv{number}(e.g., <codwhereAlpha()— Constrain a route variable to only match alphabetic characters (a-zA-Z). Similar to Laravel’swhereAlpha()whereAlphaNumeric()— Constrain a route variable to only match alphanumeric characters (a-zA-Z0-9). Similar to Laravel’swhereAlphaNumerwhereIn()— Constrain a route variable to only match one of a set of allowed values. Similar to an enum constraint.whereMatch()— Constrain a route variable with a custom regex pattern.whereNumber()— Constrain a route variable to only match numeric values (digits). Similar to Laravel’swhereNumber()or ASPwhereSlug()— Constrain a route variable to only match URL-friendly slug values (lowercase alphanumeric and hyphens).whereUuid()— Constrain a route variable to only match UUID values. Similar to ASP.NET’s:guidconstraint.wildcard()— Special wildcard matching generates routes with `