Moves template options to controller

This commit is contained in:
Raul Ochoa
2015-01-20 17:45:47 +01:00
parent 7901a05b55
commit 5962141114
2 changed files with 6 additions and 5 deletions
-5
View File
@@ -227,11 +227,6 @@ var CartodbWindshaft = function(serverOptions) {
);
};
ws.options(template_baseurl + '/:template_id', function(req, res) {
ws.doCORS(res, "Content-Type");
return next();
});
// Instantiate a template
function instanciateTemplate(req, res, template_params, callback) {
ws.doCORS(res);
+6
View File
@@ -20,6 +20,7 @@ TemplateMapsController.prototype.register = function(app) {
app.get(this.templateBaseUrl + '/:template_id', this.retrieve.bind(this));
app.del(this.templateBaseUrl + '/:template_id', this.destroy.bind(this));
app.get(this.templateBaseUrl, this.list.bind(this));
app.options(this.templateBaseUrl + '/:template_id', this.options.bind(this));
};
// Add a template
@@ -288,6 +289,11 @@ TemplateMapsController.prototype.list = function(req, res) {
);
};
TemplateMapsController.prototype.options = function(req, res) {
this.app.doCORS(res, "Content-Type");
return next();
};
/**
* jsonp endpoint, allows to instantiate a template with a json call.
* callback query argument is mandatory