404 on POST Request to Heroku Server

Viewed 320

I am building a dashboard application, my front-end is React and I use flask in the back-end. My back-end have some functions to scrape web and return the data as response. I deployed my flask app on heroku and it's working well (request type is POST). I tried sending the requests with Postman and I'm getting the results.

On my react application, when both back-end and front-end are running on localhost I successfully get results, but when I try to make a POST request to the heroku server I get CORS blocked Warning, and when I deploy my react app to Netlify, I get a 404 back.

I use axios for requests,

const axios = require('axios');

const get_unity_links = (data) =>{
  return new Promise((resolve,reject)=>{
    axios.post('crawlers/unity/get-links',data).then((result)=>{
      resolve(result.data)
    }).catch((err)=>{
      reject(err)
    })
  })
}

I have proxy:{domain of my heroku app} in my package.json as well.

0 Answers
Related