0

I want to POST the data from body to mongodb but when i use CORS then i am not able to post the data , GET method in working. What configuration we have to make in CORS middleware

  • 1
    Context would be useful here. Use cors is too broad to let anyone help you. What are you trying now? What is the error? – Lev Dec 02 '18 at 07:13
  • I am trying to POST data to mongo db using express js, but 'Cannot POST /url' is showing , i am using MERN stack, – Abhishek Verma Dec 02 '18 at 07:25
  • https://stackoverflow.com/questions/35931135/cannot-post-error-using-express – Lev Dec 02 '18 at 07:44

1 Answers1

0

This error and resolution came up as the first result of my google query using your error message and expressjs Cannot POST / error using express

Lev
  • 74
  • 5
  • Generally when i post data to mongo using express js.. It always work.. but as i start using CORS the post method not working – Abhishek Verma Dec 02 '18 at 10:01