If you look through the issues of the template you will find a lot of answers. Especially Issue #456 is discussing this topic by using a proxy. The proxy will just mirror the api to run through the local enviroment. So you do not have any CORS issues.
Another source is in the documentation folder: Backend. It basically suggest to use a proxy table which will mirror your local calls to some kind of backend. I like to run two different types of projects (one asp.net core web api and this template).
Edit your config/index.js to something like:
// config/index.js
module.exports = {
// ...
dev: {
proxyTable: {
// proxy all requests starting with /api to jsonplaceholder
'/api': {
target: 'http://localhost:5431',
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
}
}
}
Requests to /api/posts/1
will be mirrored to http://localhost:5431/posts/1
.