Im creating a very basic login page and i'm trying to use php to verify the user login. Here is the code I'm using to access the php file.
axios.post("login.php", {
user: 'Fred',
pass: 'Flintstone'
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
The PHP file is located within the src folder of the react app.
── src
│ ├── components
│ │ ├── BrowsePage
│ │ │ ├── BrowsePage.css
│ │ │ ├── BrowsePage.js
│ │ │ └── default.jpg
│ │ ├── CreatePage
│ │ │ ├── CreatePage.css
│ │ │ └── CreatePage.js
│ │ ├── Header
│ │ │ ├── Header.css
│ │ │ └── Header.js
│ │ ├── LoginPage
│ │ │ ├── LoginPage.css
│ │ │ ├── LoginPage.js
│ │ │ └── logo.svg
│ │ ├── ProfilePage
│ │ │ ├── ProfilePage.css
│ │ │ └── ProfilePage.js
│ │ └── RecPage
│ │ ├── default.jpg
│ │ ├── RecPage.css
│ │ └── RecPage.js
│ ├── index.css
│ ├── index.js
│ ├── login.php
│ └── registerServiceWorker.js
When I make the call it logs
xhr.js:178 POST http://localhost:3000/login.php 404 (Not Found)
The current path to the php document does not work, and none of the others I've tried work. What is the path to make an axios call to this php document?