Axios запрашивает не в том порте
const [products, setProducts] = React.useState([]); React.useEffect(() => {
const fetchData = async () => {
const result = await axios.get('api/products');
setProducts(result.data);
};
fetchData();},
[]);
вот package
{"name": "client","proxy": "http://localhost:5000","version": "0.1.0","private": true,"dependencies": {
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.2.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^0.27.2",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"},"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"},"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"]},"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
} }
после обновления страницы получаю ошибку GET http://localhost:3000/api/products 404 (Not Found) хотя данные находятся на порте - 5000