diff --git a/docker/production.yml b/docker/production.yml index 2e5faa4846..01107f68cf 100644 --- a/docker/production.yml +++ b/docker/production.yml @@ -42,6 +42,7 @@ services: # Environment values we expect from our legacy .env file - NODE_ENV - PORT + - POSTS_URL - API_URL - LOG_LEVEL - FEED_URL diff --git a/src/backend/utils/indexer.js b/src/backend/utils/indexer.js index bb2de504ba..05c11e9be7 100644 --- a/src/backend/utils/indexer.js +++ b/src/backend/utils/indexer.js @@ -2,7 +2,7 @@ require('../lib/config'); const { setIntervalAsync, clearIntervalAsync } = require('set-interval-async/dynamic'); -const { ELASTIC_MAX_RESULTS_PER_PAGE = 5 } = process.env; +const { ELASTIC_MAX_RESULTS_PER_PAGE = 5, POSTS_URL = 'http://localhost/v1/posts' } = process.env; const { client } = require('../lib/elastic'); const { logger } = require('./logger'); @@ -120,7 +120,7 @@ const search = async ( return { results: hits.total.value, - values: hits.hits.map(({ _id }) => ({ id: _id, url: `/posts/${_id}` })), + values: hits.hits.map(({ _id }) => ({ id: _id, url: `${POSTS_URL}/${_id}` })), }; };