Back to Sails

`sails.config.routes`

docs/reference/sails.config/sails.config.routes.md

12.12.2000840 B
Original Source

sails.config.routes

Configuration for custom (aka "explicit") routes. sails.config.routes is a dictionary whose keys are URL paths (the "route address") and whose values are one of several types of route handler configurations (called the "route target").

For example:

module.exports.routes = {

    'GET /': { view: 'pages/homepage' },
    'POST /foo/bar': { action: 'foo/bar' }
}

Please see the routes concept overview for a full discussion of Sails routes, and the custom routes documentation for a detailed description of the available configurations for both the route address and route target.

<docmeta name="displayName" value="sails.config.routes"> <docmeta name="pageType" value="property">