diff --git a/src/API/api.ts b/src/API/api.ts index 1571af4b..9b392da9 100644 --- a/src/API/api.ts +++ b/src/API/api.ts @@ -1,6 +1,8 @@ import axios from "axios"; import { IAdvertisement, IGenre, IPlaylist, ISong } from "../models/IModels"; +const localhost = process.env.REACT_APP_LOCALHOST || 'http://localhost:3000'; + export function getPlaylistsByGenre(genre: string, playlists: IPlaylist[]) { return playlists.filter((playlist: IPlaylist) => playlist.genres.includes(genre)); @@ -8,13 +10,12 @@ export function getPlaylistsByGenre(genre: string, playlists: IPlaylist[]) { export async function getPlaylists() { - return await axios.get('playlists'); + return await axios.get(`${localhost}playlists`); } - export async function getPlaylist(id: string) { - return await axios.get('http://localhost:3000/playlists/' + id); + return await axios.get(`${localhost}playlists/` + id); } diff --git a/src/components/mainComponents/Header.tsx b/src/components/mainComponents/Header.tsx index 6cffa39e..eeae08c3 100644 --- a/src/components/mainComponents/Header.tsx +++ b/src/components/mainComponents/Header.tsx @@ -4,7 +4,7 @@ import { UserOutlined } from '@ant-design/icons'; export function Header() { return ( -
+

😈 DEVIL music