2

I've read the documentation for the webpack-dev-server and how to setup a proxy, but it's not working for me. What I want to do is have an API_ROOT to http://my_external_server.com/api and then use that in ajax requests. In my config I have:

proxy: {
    'http://my_external_server.com/api/*' : {
        target: 'http://127.0.0.1:8000/api/',
        secure: false
    }
}

Here is my full config.

ukejoe
  • 737
  • 2
  • 9
  • 20

1 Answers1

3

You just need to replace key with target like that:

proxy: {
  '/api/*' : {
    target: 'http://my_external_server.com',
    secure: false
  }
}
freakycue
  • 51
  • 4