Each Application using Lanes get it’s own routes file in config/routes.rb, which has a mix of both Rails and Sinatra. With it you can establish REST endpoints for a model very easily.

Given an Lanes model Customer, Address, and Account for an application “banking”:

Lanes::API.routes.draw("banking") do
    resources Customer
    resource Address, under: Customer
    resource Account, immutable: true
    get "favorites" do
        { customers: Customer.favorites.as_json }
    end
end

The following routes will be created:

GET    /banking/customer/?:id?.json # Retrieve with optional Query parmaeters
POST   /banking/customer.json       # Create new customer
PUT    /banking/customer/:id.json   # Update an existing Customer.  All attributes should be specified
PATCH  /banking/customer/:id.json   # Update an existing Customer with only the given attributes.
DELETE /banking/customer/:id.json   # Delete a customer record

GET    /banking/customer/:id/address/?:id?.json # Retrieve Address for customer with optional Query parmaeters
POST   /banking/customer/:id/address.json       # Create new Address for customer
PUT    /banking/customer/:id/address/:id.json   # Update a Customer's existing Address
PATCH  /banking/customer/:id/address/:id.json   # Update a Customer's existing Address with only the given attributes.
DELETE /banking/customer/:id/address/:id.json   # Delete a Address record

GET    /banking/account/?:id?.json # Retrieve Account with optional Query parmaeters

GET    /banking/favorites

As you can see above, all routes are nested under the “banking” prefix. This allows multiple applications to co-exist without trampling over each other’s routes.