-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #2014: Adds search service to the front-end #2140
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated Vercel to add the Search URL env var:
14:44:10.365 | Running "npm run build"
-- | --
14:44:10.659 | > @senecacdot/[email protected] build /vercel/workpath0
14:44:10.659 | > next build && next export
14:44:11.683 | info - Using webpack 5. Reason: future.webpack5 option enabled https://nextjs.org/docs/messages/webpack5
14:44:11.881 | Trying to load missing ENV variables from /.env
14:44:11.881 | Trying to load missing ENV variables from /config/env.development
14:44:11.881 | Using NEXT_PUBLIC_WEB_URL=https://telescope-c64dfl18s-humphd.vercel.app
14:44:11.881 | Using NEXT_PUBLIC_API_URL=https://dev.telescope.cdot.systems
14:44:11.881 | Using NEXT_PUBLIC_IMAGE_URL=https://dev.api.telescope.cdot.systems/v1/image
14:44:11.881 | Using NEXT_PUBLIC_POSTS_URL=https://dev.api.telescope.cdot.systems/v1/posts
14:44:11.881 | Using NEXT_PUBLIC_AUTH_URL=https://dev.api.telescope.cdot.systems/v1/auth
14:44:11.881 | Using NEXT_PUBLIC_SEARCH_URL=https://dev.api.telescope.cdot.systems/v1/search
But it's getting a 404 from https://dev.api.telescope.cdot.systems/v1/search/query?text=react&filter=post&page=0. What am I missing? Is it the extra /query
? in that URL?
docker/production.yml
Outdated
@@ -141,6 +143,7 @@ services: | |||
environment: | |||
- ELASTIC_URL=http://elasticsearch | |||
- ELASTIC_PORT=9200 | |||
- SEARCH_PORT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be necessary, we do it in docker-compose.yml.
Think it's this piece that @manekenpix mentioned when fixing the search url awhile back |
@@ -54,7 +54,9 @@ const SearchResults = () => { | |||
const { textParam, filter } = useSearchValue(); | |||
|
|||
const prepareUrl = (index: number) => | |||
`${telescopeUrl}/query?text=${encodeURIComponent(textParam)}&filter=${filter}&page=${index}`; | |||
`${searchServiceUrl}/query?text=${encodeURIComponent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it works without query
in the URL
`${searchServiceUrl}/query?text=${encodeURIComponent( | |
`${searchServiceUrl}?text=${encodeURIComponent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to keep using query
, this line should be:
service.router.use('/query', query);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want /query
any more, please remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good except for the /query
path, please remove that and I'll retest/review.
Issue This PR Addresses
This PR closes #2014
Type of Change
Description
Now that the search service is functional and merged, we can finally work towards moving it to the front-end. This PR addresses that by adding the search service related arguments to the Dockerfile, the production.yml file, the next.config.js file, the config.ts file, and finally the relevant components that make requests to this endpoint. One bug in the search service is preventing this from working and so I'll need to address that before this PR is ready for review.
Checklist