Skip to content

Commit

Permalink
refact(ui): update api base url
Browse files Browse the repository at this point in the history
  • Loading branch information
felipetodev committed Sep 13, 2024
1 parent b2e8629 commit fdd510c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions frontend/src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/api/search.ts
Original file line number Diff line number Diff line change
@@ -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) => {
Expand All @@ -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',
},
Expand Down

0 comments on commit fdd510c

Please sign in to comment.