Handling POST request with axios and express
I don't have enough reputation to comment on Jim's last post but I had the same problem and that solved it!
To clarify: In my server.js file I was requiring my routes before these:
these first:
app.use(express.urlencoded({ extended: true }));app.use(express.json());
then this:
app.use(routes);
Add following parser to handle the requested data
var bodyParser = require('body-parser');app.use(bodyParser.urlencoded({ extended: true }));app.use(bodyParser.json())
Turns out I had all my middleware installed out of order; I was attempting to handle the POST in my server.js file prior to using any middleware.