Skip to content

Commit

Permalink
hotfix: use app.ferndocs.com host for chat streaming (#1970)
Browse files Browse the repository at this point in the history
  • Loading branch information
dubwub authored Jan 9, 2025
1 parent d2080ed commit 7bea0ff
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/fern-docs/ui/src/search/SearchV2.tsx
Original file line number Diff line number Diff line change
@@ -86,8 +86,13 @@ export function SearchV2(): ReactElement | false {
});

const facetApiEndpoint = useApiRoute("/api/fern-docs/search/v2/facet");
const chatEndpoint = useApiRoute("/api/fern-docs/search/v2/chat");
const suggestEndpoint = useApiRoute("/api/fern-docs/search/v2/suggest");
let chatEndpoint = useApiRoute("/api/fern-docs/search/v2/chat");
let suggestEndpoint = useApiRoute("/api/fern-docs/search/v2/suggest");

if (process.env.NODE_ENV === "production") {
chatEndpoint = `https://app.ferndocs.com/api/fern-docs/search/v2/chat`;
suggestEndpoint = `https://app.ferndocs.com/api/fern-docs/search/v2/suggest`;
}

const router = useRouter();

@@ -160,6 +165,7 @@ export function SearchV2(): ReactElement | false {
askAI={askAi}
setAskAI={setAskAi}
api={chatEndpoint}
headers={{ "X-Fern-Host": domain }}
suggestionsApi={suggestEndpoint}
initialInput={initialInput}
setInitialInput={setInitialInput}

0 comments on commit 7bea0ff

Please sign in to comment.