Browse Source

Merge pull request #907 from pelias/add-parser-prefix-to-placeholder-config

moved 'parser' placeholder url part to service config
pull/908/head
Stephen K Hess 7 years ago committed by GitHub
parent
commit
5bcbebf7be
  1. 2
      service/configurations/PlaceHolder.js
  2. 6
      test/unit/service/configurations/PlaceHolder.js

2
service/configurations/PlaceHolder.js

@ -24,7 +24,7 @@ class PlaceHolder extends ServiceConfiguration {
}
getUrl(req) {
return url.resolve(this.baseUrl, 'search');
return url.resolve(this.baseUrl, 'parser/search');
}
}

6
test/unit/service/configurations/PlaceHolder.js

@ -29,7 +29,7 @@ module.exports.tests.all = (test, common) => {
const placeholder = new PlaceHolder(configBlob);
t.equals(placeholder.getUrl(), 'http://localhost:1234/search');
t.equals(placeholder.getUrl(), 'http://localhost:1234/parser/search');
t.end();
});
@ -114,14 +114,14 @@ module.exports.tests.all = (test, common) => {
test('baseUrl ending in / should not have double /\'s return by getUrl', (t) => {
const configBlob = {
url: 'http://localhost:1234/blah',
url: 'http://localhost:1234/',
timeout: 17,
retries: 19
};
const placeholder = new PlaceHolder(configBlob);
t.deepEquals(placeholder.getUrl(), 'http://localhost:1234/blah/search');
t.deepEquals(placeholder.getUrl(), 'http://localhost:1234/parser/search');
t.end();
});

Loading…
Cancel
Save