Skip to content

Commit

Permalink
fix: api url when deployed
Browse files Browse the repository at this point in the history
  • Loading branch information
sinedied committed Apr 4, 2024
1 parent b937b79 commit c8e7b56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/webapp/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { type ChatResponse, type ChatRequestOptions, type ChatResponseChunk } from './models.js';

export const apiBaseUrl: string = import.meta.env.VITE_API_URL || 'api';
export const apiBaseUrl: string = import.meta.env.VITE_API_URL || '';

export async function getCompletion(options: ChatRequestOptions) {
const apiUrl = options.apiUrl || apiBaseUrl;
const response = await fetch(`${apiUrl}/chat`, {
const response = await fetch(`${apiUrl}/api/chat`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
Expand Down

0 comments on commit c8e7b56

Please sign in to comment.