I'm trying to upload image with React. Source code copied from:
https://www.geeksforgeeks.org/file-uploading-in-react-js/
Image upload required post API call eg, App.js#line39
API is Lumen. Source code is named scr-webservice.
- source code directory: ~/my/scr-webservice.
- source code tool: phpstorm
- url: http://localhost:8000/
- Database is currently (29/8/21) pointing to winhost by ~/my/scr-webservice/.env
- database tool: phpstorm
Post call:
http://localhost:8000/api/imageupload
There is a very good video of image upload using React.js:
https://www.youtube.com/watch?v=XeiOnkEI7XI
Talks about axios post call at video 4:20, but using Firebase, which takes another learning time.
Found another good site talking about React and Lumen connection:
- From: react website localhost:3000
- To: API localhost:8000 (LUmen)