mirror of https://github.com/pelias/api.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
660 B
36 lines
660 B
const _ = require('lodash'); |
|
|
|
function PlaceHolder( baseUrl ){ |
|
this.baseUrl = baseUrl; |
|
} |
|
|
|
PlaceHolder.prototype.getName = function() { |
|
return 'placeholder'; |
|
}; |
|
|
|
PlaceHolder.prototype.getBaseUrl = function() { |
|
return this.baseUrl; |
|
}; |
|
|
|
PlaceHolder.prototype.getUrl = function(req) { |
|
return `${this.baseUrl}/search`; |
|
}; |
|
|
|
PlaceHolder.prototype.getParameters = function(req) { |
|
const parameters = { |
|
text: req.clean.text |
|
}; |
|
|
|
if (_.has(req.clean, 'lang.iso6393')) { |
|
parameters.lang = req.clean.lang.iso6393; |
|
} |
|
|
|
return parameters; |
|
}; |
|
|
|
PlaceHolder.prototype.getHeaders = function(req) { |
|
return {}; |
|
}; |
|
|
|
// export |
|
module.exports = PlaceHolder;
|
|
|