Update Meilisearch endpoint and documentation references - #62
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Astro web app’s Meilisearch production proxy path from /api to /search, aligning docs and deployment configuration so /api/ can be reserved for the data API.
Changes:
- Updated
MEILI_URLproduction value from/apito/searchin deployment script output (.env.production) and related documentation. - Adjusted the Astro search wrapper to treat
MEILI_URLas the full proxy endpoint and tofetch()that endpoint directly in proxy mode. - Updated repo-level and app-level CLAUDE documentation to describe the new
/searchproxy behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| scripts/deploy.sh | Writes MEILI_URL=/search into apps/astro/.env.production during deploys |
| apps/astro/src/lib/search.ts | Uses /search proxy in production and simplifies proxy-mode fetch logic |
| apps/astro/CLAUDE.md | Updates env var guidance and production search proxy references |
| CLAUDE.md | Updates repo-wide operational note about the production search proxy path |
Comments suppressed due to low confidence (1)
apps/astro/src/lib/search.ts:33
initSearch()requires anapiKeyeven in proxy mode, but proxy mode ignores it. Consider makingapiKeyoptional (or using a proxy/direct discriminated union) so call sites don’t need to pass/shipMEILI_SEARCH_KEYwhenhostis a relative proxy endpoint.
export function initSearch(config: { host: string; apiKey: string }): void {
if (config.host.startsWith("/")) {
searchMode = "proxy";
proxyEndpoint = config.host;
} else {
searchMode = "direct";
client = new Meilisearch({
host: config.host,
apiKey: config.apiKey,
});
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This pull request updates the Meilisearch production proxy endpoint from
/apito/searchthroughout the documentation, environment variables, deployment scripts, and application code. This change clarifies the separation between the search proxy and the data API, ensuring the/api/namespace is reserved for the data API (Hono). The switch is reflected in both user-facing documentation and internal implementation.Proxy Endpoint Update
/apito/searchin documentation (CLAUDE.md), clarifying that/api/is reserved for the data API. [1] [2] [3]MEILI_URLenvironment variable in documentation to use/searchfor production, matching the new proxy endpoint.Application and Script Changes
apps/astro/src/lib/search.tsto use/searchas the proxy endpoint in production, including logic for proxy mode detection and fetch calls. [1] [2] [3]scripts/deploy.sh) to setMEILI_URL=/searchfor production environments. [1] [2]