class Grape::Middleware::Versioner::Path

This middleware sets various version related rack environment variables based on the uri path and removes the version substring from the uri path. If the version substring does not match any potential initialized versions, a 404 error is thrown.

Example: For a uri path

/v1/resource

The following rack env variables are set and path is rewritten to ‘/resource’:

env['api.version'] => 'v1'