Commit Graph
68 Commits
Author SHA1 Message Date
Simon Martín 21720267cf from req.context to res.locals 2017-10-03 17:47:57 +02:00
Simon Martín 3ce10690d6 send res.locals instead of res when possible 2017-10-03 13:06:12 +02:00
Simon Martín f9d87bc40f res.locals fixing controllers 2017-10-02 12:07:35 +02:00
Simon Martín 783eb0eec7 res.locals format and layer in namep maps 2017-09-29 17:03:57 +02:00
Simon Martín 482feabce2 res.locals in named maps controller 2017-09-29 14:37:55 +02:00
Simon 540fda1e6c Merge branch 'master' into middlewarify 2017-09-26 14:53:57 +02:00
Daniel García Aubert 4899c7ffef Inject prepare context middleware to controllers 2017-09-25 19:40:27 +02:00
Daniel García Aubert b236112069 Split prepare context middleware and fix unit test 2017-09-25 13:40:22 +02:00
Daniel García Aubert 3bab081438 Rename req2params by prepareContext 2017-09-22 17:56:47 +02:00
Daniel García Aubert 8139cdf8b2 Use req2params middleware for name maps static views endpoint 2017-09-22 00:58:44 +02:00
Daniel García Aubert a8898a8022 Use req2params middleware for name maps tile endpoint 2017-09-22 00:48:44 +02:00
Daniel García Aubert 429f070372 Pass node's response object to req2params 2017-09-21 12:22:33 +02:00
Daniel García Aubert daeae5d95c Implement error-middleware to handle errors at top level 2017-09-21 11:46:42 +02:00
Raul Ochoa 91ce3a5489 Going green: allow to use bbox param, along lon, lat, and zoom
The `bbox` param was removed from the base controller, the rest kept
working as they are declared in the base, but it's better to declare
them here as well.

Fixes #735.
2017-08-29 13:05:03 +00:00
Raul Ochoa c325df1414 Merge pull request #655 from CartoDB/static-maps-layers-filter
Static maps layers filter
2017-04-03 12:07:38 +02:00
Raul Ochoa cad02bfad7 Remove all conditional branches to call req.profiler
req.profiler is created in a middleware for all requests.
2017-03-30 20:31:53 +02:00
Raul Ochoa 94299f0452 Configure extra allowed params per endpoint via middleware
Instead of making all params available in all endpoints, we control
what endpoints allow what extra params.

Dataviews endpoints should be migrated to this.
2017-03-30 20:12:55 +02:00
Daniel García Aubert 908070ecd7 Fix jshint issue 2016-09-01 16:53:10 +02:00
Daniel García Aubert 7c6a58cd30 Made explicit to recreate named-map-provider 2016-09-01 16:42:06 +02:00
Daniel García Aubert b0990a1132 Removed template-maps backend from named-maps controller 2016-09-01 16:31:30 +02:00
Daniel García Aubert e0d304b033 Applied approach similar to static image options 2016-09-01 12:37:04 +02:00
Daniel García Aubert 1bed8623a2 Overwrites rendererparams instead of layergroup in mapconfig 2016-08-31 20:40:55 +02:00
Daniel García Aubert 30c4b00f33 New approach: decorates named_map_provider to return the with visible layers 2016-08-31 19:40:00 +02:00
Raul Ochoa 6639664b3f Allow override zoom+center or bbox for static named maps previews 2016-05-09 21:13:13 +02:00
Alejandro Martínez cf06ff86c2 Use node-cartodb-query-tables library 2016-02-22 11:40:25 +01:00
Alejandro Martínez 95ab99be4d Use new CDB_QueryTablesUpdatedAt function 2016-02-09 19:06:34 +01:00
Raul Ochoa 3181bcc63e Remove app dependency from controllers 2015-09-30 18:00:54 +02:00
Raul Ochoa 9cd67f06c1 User extraction from request middleware
Used only where potentially a user is required.

It doesn't make sense to extract a user for request that don't need
a user in the context.
2015-09-30 17:17:01 +02:00
Raul Ochoa f2278d47a5 Increment map views on static preview images 2015-09-29 12:21:11 +02:00
Raul Ochoa 84bf375f72 Makes cache async 2015-09-23 14:32:26 +02:00
Raul Ochoa c8705a8022 Use provider to get affected tables in static maps 2015-09-23 13:04:46 +02:00
Raul Ochoa 2bdce4baa7 Replaces console.log with global logger 2015-09-18 17:13:22 +02:00
Raul Ochoa a4ba21f9db Call send with correct params 2015-09-17 02:05:25 +02:00
Raul Ochoa ef86bacf7f Set headers with set method 2015-09-17 02:03:09 +02:00
Raul Ochoa 38e422e84c Moves sendError and sendResponse to Base controller
Test for findStatusCode moved to controller
2015-09-16 21:54:56 +02:00
Raul Ochoa e32ced107e Fix all ported tests related to req2params 2015-09-16 18:09:39 +02:00
Raul Ochoa 352dc6b311 BaseController to encapsulate req2params method
All controllers now extending BaseController
- Most of the acceptance ported tests will be broken
2015-09-16 16:18:26 +02:00
Raul Ochoa 72a0c4a487 New sendResponse and sendError methods
- fixes response for static named map error cases
2015-09-16 01:36:51 +02:00
Raul Ochoa fba5a35514 Move sendResponse and sendError to response object 2015-09-15 19:28:02 +02:00
Raul Ochoa 2ac228359f Fallback to image/png header 2015-07-31 12:23:36 +02:00
Raul Ochoa 722705468f Not adding surrogate keys for empty affected tables 2015-07-14 20:53:26 +02:00
Raul Ochoa 07c920bad5 Use named map provider cache to retrieve providers 2015-07-14 20:53:06 +02:00
Raul Ochoa 4aabe9d946 Named maps controller adding cache headers
This requires a cache for affected tables as it is hitting db for
every request right now
2015-07-14 20:10:55 +02:00
Raul Ochoa 7247b20686 Unify sendResponse in named maps controller 2015-07-14 17:34:05 +02:00
Raul Ochoa c295584864 Cache channel now in layergroup controller
Internal cache channel dbname+layergroupid cache must be unified in layergroup
and map controllers
Removes sendWithHeaders
2015-07-14 11:55:49 +02:00
Raul Ochoa 316f08df08 named maps tiles sending tile headers 2015-07-13 11:53:23 +02:00
Raul Ochoa f9554ec761 Re-enable render limits 2015-07-10 19:10:55 +02:00
Raul Ochoa 9bece712a9 Splits controllers and supports after layergroup creation actions 2015-07-10 11:24:32 +02:00
Raul Ochoa 579cabdc1a Initial refactor of layergroup creation 2015-07-10 01:30:38 +02:00
Raul Ochoa 5aad624346 NamedMaps controller using NamedMapMapConfigProvider
PreviewBackend with format param
2015-07-09 18:47:21 +02:00