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.
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const url = require('url');
|
|
|
|
|
|
|
|
const _ = require('lodash');
|
|
|
|
|
|
|
|
const ServiceConfiguration = require('pelias-microservice-wrapper').ServiceConfiguration;
|
|
|
|
|
|
|
|
class PlaceHolder extends ServiceConfiguration {
|
|
|
|
constructor(o) {
|
|
|
|
super('placeholder', o);
|
|
|
|
}
|
|
|
|
|
|
|
|
getParameters(req) {
|
|
|
|
const parameters = {
|
|
|
|
text: req.clean.text
|
|
|
|
};
|
|
|
|
|
|
|
|
if (_.has(req.clean, 'lang.iso6393')) {
|
|
|
|
parameters.lang = req.clean.lang.iso6393;
|
|
|
|
}
|
|
|
|
|
|
|
|
return parameters;
|
|
|
|
}
|
|
|
|
|
|
|
|
getUrl(req) {
|
|
|
|
return url.resolve(this.baseUrl, 'parser/search');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = PlaceHolder;
|