diff --git a/frontend/.env.sample b/frontend/.env.sample new file mode 100644 index 0000000..b8f5336 --- /dev/null +++ b/frontend/.env.sample @@ -0,0 +1 @@ +VITE_BACKEND_URL="" diff --git a/frontend/.gitignore b/frontend/.gitignore index a547bf3..3b0b403 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -22,3 +22,5 @@ dist-ssr *.njsproj *.sln *.sw? + +.env \ No newline at end of file diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 0ea5c8a..4a26757 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -13,12 +13,9 @@ const App = () => { const fetchSongData = async () => { try { - const response = await axios.get( - "https://spring-music-player-3hyj.vercel.app/search", - { - params: { song: searchQuery }, - } - ); + const response = await axios.get(import.meta.env.VITE_BACKEND_URL, { + params: { song: searchQuery }, + }); setData(response.data); } catch (error) { console.error(error);