diff --git a/config/environments/development.js.example b/config/environments/development.js.example index adc7aa1d..54761d97 100644 --- a/config/environments/development.js.example +++ b/config/environments/development.js.example @@ -17,12 +17,12 @@ var config = { // // See https://github.com/CartoDB/Windshaft-cartodb/wiki/Unified-Map-API ,routes: { - v1: { + api: { paths: [ '/api/v1', '/user/:user/api/v1', ], - // Attach middlewares at the begining of the req/res cycle + // Optional: attach middlewares at the begining of the req/res cycle // to perform custom operations. middlewares: [ function noop () { @@ -37,34 +37,15 @@ var config = { paths: [ '/map', ], - middlewares: [] + middlewares: [] // Optional }, // Base url for the Templated Maps API // "/api/v1/map/named" is the new API, template: { paths: [ '/map/named' - ] - } - }, - // For compatibility with versions up to 1.6.x - v0: { - paths: [ - '/tiles' - ], - // Base url for the Detached Maps API - // "/tiles/layergroup" is for compatibility with versions up to 1.6.x - map: { - paths: [ - '/layergroup' - ] - }, - // Base url for the Templated Maps API - // "/tiles/template" is for compatibility with versions up to 1.6.x - template: { - paths: [ - '/template' - ] + ], + middlewares: [] // Optional } } } diff --git a/config/environments/production.js.example b/config/environments/production.js.example index 9173c53b..623623c2 100644 --- a/config/environments/production.js.example +++ b/config/environments/production.js.example @@ -17,12 +17,12 @@ var config = { // // See https://github.com/CartoDB/Windshaft-cartodb/wiki/Unified-Map-API ,routes: { - v1: { + api: { paths: [ '/api/v1', '/user/:user/api/v1', ], - // Attach middlewares at the begining of the req/res cycle + // Optional: attach middlewares at the begining of the req/res cycle // to perform custom operations. middlewares: [ function noop () { @@ -37,34 +37,15 @@ var config = { paths: [ '/map', ], - middlewares: [] + middlewares: [] // Optional }, // Base url for the Templated Maps API // "/api/v1/map/named" is the new API, template: { paths: [ '/map/named' - ] - } - }, - // For compatibility with versions up to 1.6.x - v0: { - paths: [ - '/tiles' - ], - // Base url for the Detached Maps API - // "/tiles/layergroup" is for compatibility with versions up to 1.6.x - map: { - paths: [ - '/layergroup' - ] - }, - // Base url for the Templated Maps API - // "/tiles/template" is for compatibility with versions up to 1.6.x - template: { - paths: [ - '/template' - ] + ], + middlewares: [] // Optional } } } diff --git a/config/environments/staging.js.example b/config/environments/staging.js.example index 123ce930..f3baa4fa 100644 --- a/config/environments/staging.js.example +++ b/config/environments/staging.js.example @@ -17,12 +17,12 @@ var config = { // // See https://github.com/CartoDB/Windshaft-cartodb/wiki/Unified-Map-API ,routes: { - v1: { + api: { paths: [ '/api/v1', '/user/:user/api/v1', ], - // Attach middlewares at the begining of the req/res cycle + // Optional: attach middlewares at the begining of the req/res cycle // to perform custom operations. middlewares: [ function noop () { @@ -37,34 +37,15 @@ var config = { paths: [ '/map', ], - middlewares: [] + middlewares: [] // Optional }, // Base url for the Templated Maps API // "/api/v1/map/named" is the new API, template: { paths: [ '/map/named' - ] - } - }, - // For compatibility with versions up to 1.6.x - v0: { - paths: [ - '/tiles' - ], - // Base url for the Detached Maps API - // "/tiles/layergroup" is for compatibility with versions up to 1.6.x - map: { - paths: [ - '/layergroup' - ] - }, - // Base url for the Templated Maps API - // "/tiles/template" is for compatibility with versions up to 1.6.x - template: { - paths: [ - '/template' - ] + ], + middlewares: [] // Optional } } } diff --git a/config/environments/test.js.example b/config/environments/test.js.example index fae21737..f41e4ca9 100644 --- a/config/environments/test.js.example +++ b/config/environments/test.js.example @@ -17,44 +17,35 @@ var config = { // // See https://github.com/CartoDB/Windshaft-cartodb/wiki/Unified-Map-API ,routes: { - v1: { + api: { paths: [ '/api/v1', '/user/:user/api/v1', ], + // Optional: attach middlewares at the begining of the req/res cycle + // to perform custom operations. + middlewares: [ + function noop () { + return function noopMiddleware (req, res, next) { + next(); + } + } + ], // Base url for the Detached Maps API // "/api/v1/map" is the new API, map: { paths: [ '/map', - ] + ], + middlewares: [] // Optional }, // Base url for the Templated Maps API // "/api/v1/map/named" is the new API, template: { paths: [ '/map/named' - ] - } - }, - // For compatibility with versions up to 1.6.x - v0: { - paths: [ - '/tiles' - ], - // Base url for the Detached Maps API - // "/tiles/layergroup" is for compatibility with versions up to 1.6.x - map: { - paths: [ - '/layergroup' - ] - }, - // Base url for the Templated Maps API - // "/tiles/template" is for compatibility with versions up to 1.6.x - template: { - paths: [ - '/template' - ] + ], + middlewares: [] // Optional } } }