werein / react

Extremely simple boilerplate, easiest you can find, for React application including all the necessary tools: Flow | React 16 | redux | babel 6 | webpack 3 | css-modules | jest | enzyme | express + optional: sass/scss

Home Page:https://wereinhq.com/guides/react

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Api proxy doesn't seem to be working for me

pea opened this issue · comments

Thanks for the repo, it's been a great help. The proxy that should route localhost:8080/api to localhost:8181 doesn't seem to be working though.

I think I've found the solution though based on this.

devServer: {
    historyApiFallback: true,
    proxy: {
      '/api/*': {
        target: 'http://localhost:8181',
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  }