Skip to content

Commit

Permalink
Merge pull request #2075 from manekenpix/fix-search-vercel
Browse files Browse the repository at this point in the history
Fix search page for vercel.
  • Loading branch information
manekenpix authored Apr 4, 2021
2 parents 2fc3107 + 9a35eb1 commit f0bc060
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions docker/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/backend/utils/indexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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}` })),
};
};

Expand Down

0 comments on commit f0bc060

Please sign in to comment.