Skip to content

Update Meilisearch endpoint and documentation references - #62

Merged
chris-c-thomas merged 3 commits into
mainfrom
dev
Mar 22, 2026
Merged

Update Meilisearch endpoint and documentation references#62
chris-c-thomas merged 3 commits into
mainfrom
dev

Conversation

@chris-c-thomas

Copy link
Copy Markdown
Owner

This pull request updates the Meilisearch production proxy endpoint from /api to /search throughout 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

  • Changed the recommended Meilisearch proxy endpoint in production from /api to /search in documentation (CLAUDE.md), clarifying that /api/ is reserved for the data API. [1] [2] [3]
  • Updated the description of the MEILI_URL environment variable in documentation to use /search for production, matching the new proxy endpoint.

Application and Script Changes

  • Modified apps/astro/src/lib/search.ts to use /search as the proxy endpoint in production, including logic for proxy mode detection and fetch calls. [1] [2] [3]
  • Updated deployment scripts (scripts/deploy.sh) to set MEILI_URL=/search for production environments. [1] [2]

@chris-c-thomas chris-c-thomas self-assigned this Mar 22, 2026
@chris-c-thomas chris-c-thomas added docs Improvements or additions to documentation main astro labels Mar 22, 2026
@chris-c-thomas
chris-c-thomas requested a review from Copilot March 22, 2026 18:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_URL production value from /api to /search in deployment script output (.env.production) and related documentation.
  • Adjusted the Astro search wrapper to treat MEILI_URL as the full proxy endpoint and to fetch() that endpoint directly in proxy mode.
  • Updated repo-level and app-level CLAUDE documentation to describe the new /search proxy 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 an apiKey even in proxy mode, but proxy mode ignores it. Consider making apiKey optional (or using a proxy/direct discriminated union) so call sites don’t need to pass/ship MEILI_SEARCH_KEY when host is 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,
    });

Comment thread scripts/deploy.sh
Comment thread scripts/deploy.sh
Comment thread apps/astro/CLAUDE.md
Comment thread apps/astro/CLAUDE.md
@chris-c-thomas
chris-c-thomas merged commit 292622d into main Mar 22, 2026
5 checks passed
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astro docs Improvements or additions to documentation main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants