The error occurs because you're making requests directly to http://127.0.0.1:5000/api/cosplays
. When making requests from your frontend to your backend, you should use relative URLs like /api/cosplays
instead.
Example of correct usage:
// Instead of this:
axios.get('http://127.0.0.1:5000/api/cosplays')
// Do this:
axios.get('/api/cosplays')