Beispiel #1
0
exports.toolsDpValidateJSON = function(req, res) {
  // handle base urls as well as full urls
  var dpurl = req.query.url.replace(/datapackage.json$/, '');
  var dpurl = dpurl.replace(/\/$/, '');
  dpurl += '/datapackage.json';
  tools.validateUrl(dpurl, function(data) {
    res.json(data);
  });
};
Beispiel #2
0
exports.toolsDpValidate = function(req, res) {
  var url = req.query.url;
  if (!url) {
    res.render('tools/dp/validate.html');
  } else {
    tools.validateUrl(url, function(data) {
      res.render('tools/dp/validate.html', {
        url: url,
        result: data
      });
    });
  }
};