-1

It is now 1 weeks that I block on this problem. I have already tried to look for similar cases but they do not answer my problem.

The problem is: I have an API on Heroku develop in Express js and an angular interface in another server. For example, to add an article, the API works well and returns the answer with the CORS response. The problem is appear when I update. Whenever I make a PUT request, the browser checks the answer to my API (OPTIONS) if I have the permission to do it, actually I get a code 200 because I have permission to continue but after this check I get a 503 error without the previous headers.

I thank in advance those who would like to help me understand what is happening. Thank you

https://res.cloudinary.com/dkthctbvw/image/upload/v1572298933/crs_mo3iaa.jpg

axios.put(`${this.host_url}/api/posts/${newProduct._id}/update`, newProduct)
                .then(res => {
                    this.loading = false
                    this.lds.remove()
                    this.router.navigate(['/articles'])
                })
                .catch(err => console.log(err));

https://res.cloudinary.com/dkthctbvw/image/upload/v1572298573/200_afsepz.jpg

https://res.cloudinary.com/dkthctbvw/image/upload/v1572298573/503_pivluy.jpg

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197

1 Answers1

0

Error code 503 is not related to the CORS issues. It just tells you that the service is unavailable.

The HyperText Transfer Protocol (HTTP) 503 Service Unavailable server error response code indicates that the server is not ready to handle the request.

You need to check your server config and review your API. Maybe this can help you.

yazantahhan
  • 2,950
  • 1
  • 13
  • 16