Fetch API error when using Webpack devServer proxy



I have 2 servers running on my workspace: a NodeJS, webpack-dev-server on port 8080 and a Python flask server running on port 8081.
When I was developing locally, I used webpack’s proxy settings to circumvent CORS issues, like this:

devServer: {
proxy: {
’/api’: {
target: {
host: “”,
protocol: ‘http:’,
port: 8081,
pathRewrite: {’^/api’ : ‘’}

Doing this, I could make a request such as and webpack would proxy it to, with no explicit CORS handling necessary. Doing the same thing in Cloud9 environment gives me Fetch API cannot load http://[project].fmatos.c9users.io/api/hello. Response for preflight is invalid (redirect).
Is there a particular way to handle proxies, or CORS in general, when working with C9 workspaces?


Nevermind, answer is here. It’s a private project problem. Somehow I found it a minute after posting. Oops.


This actually explains the issue, but doesn’t solve it. Now I get
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
So it seems I do have to have special configs for C9 environment, even if it’s just headers. But I bet that will require my python server to handle CORS. That will be annoying.
I’ll verify later and post results.


were you able to solve the issue? any update would be appreciated!