[Vuejs]-Express and Vue. With axios, req.body is not working

0👍

This body can not be resolved because of your middleware declaration order. You can check from the following blog about middleware execution sequence. Basically it equals to middleware declaration order.

https://derickbailey.com/2016/05/09/in-what-order-does-my-express-js-middleware-execute/

Declare bodyParser middleware before router middleware can solve your problem

   app.use(bodyParser.json());
   app.use(bodyParser.urlencoded({ extended: false }));
   app.use('/api/login', login);

Leave a comment