I am now trying to create a POST request to post a lot of JSON to my SQL table, but I am not sure how to use POST with the API structure.
I can see the data of my post request in the console here:
However, it seems that Express says it cannot get the “Post” request.
Here is what my route looks like:
//Custom user entered food router.get("/new-food-entry/", updateCtrl.newFoodEntry);
And then I am just trying to console the POST data in the controller for now
//Insert a new food into main nutrient DB function newFoodEntry(req,res) { console.log("req",req); res.send("OK"); }
I am not sure how to proceed with processing the data from this post request. Any help appreciated!