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
NotesPage.jsxandlogin.jsxboth hardcodehttp://localhost:8080in every Axios call. This makes it impossible to change the backend URL without editing multiple files.Create a centralised
frontend/src/api.jsthat exports a configured Axios instance usingVITE_API_BASE_URLfrom.env.Replace all raw
axios.get/post/put/deletecalls inNotesPage.jsxandlogin.jsxwith the new instance.frontend/src/NotesPage.jsx,frontend/src/login.jsx, newfrontend/src/api.js,frontend/.env