diff --git a/frontend/src/lib/constants.ts b/frontend/src/lib/constants.ts index 17118fe..4d7fe17 100644 --- a/frontend/src/lib/constants.ts +++ b/frontend/src/lib/constants.ts @@ -1,6 +1,4 @@ -export const API_HOST = import.meta.env.DEV - ? "http://127.0.0.1:5000" - : "https://alternify.vercel.app"; +export const API_BASE_URL = "https://api-alternify.vercel.app" export const servicesAvailable = [ "genius", diff --git a/frontend/src/pages/api/search.ts b/frontend/src/pages/api/search.ts index 575b80a..c9d5913 100644 --- a/frontend/src/pages/api/search.ts +++ b/frontend/src/pages/api/search.ts @@ -1,5 +1,5 @@ import type { APIRoute } from "astro" -import { API_HOST } from "../../lib/constants" +import { API_BASE_URL } from "../../lib/constants" import { validateTrackId } from '../../lib/schemas' export const GET: APIRoute = async (request) => { @@ -16,7 +16,7 @@ export const GET: APIRoute = async (request) => { } try { - const resp = await fetch(`/track/${trackId}`, { + const resp = await fetch(`${API_BASE_URL}/track/${trackId}`, { headers: { 'Content-Type': 'application/json', },