Replace hardcoded `localhost:8080` URLs with a centralised Axios instance
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
`NotesPage.jsx` and `login.jsx` both hardcode `http://localhost:8080` in every Axios call. This makes it impossible to change the backend URL without editing multiple files.
Create a centralised `frontend/src/api.js` that exports a configured Axios instance using `VITE_API_BASE_URL` from `.env`.
Replace all raw `axios.get/post/put/delete` calls in `NotesPage.jsx` and `login.jsx` with the new instance.
- Touches: `frontend/src/NotesPage.jsx`, `frontend/src/login.jsx`, new `frontend/src/api.js`, `frontend/.env`
Contributor guide
Research direction
Start by reading frontend/src/NotesPage.jsx and frontend/src/login.jsx to locate every raw Axios call and the existing localhost:8080 URLs. Then review frontend/.env and create the central client in frontend/src/api.js using VITE_API_BASE_URL. Done means both named components use the shared instance and no longer hardcode the backend URL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, frontend
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100