Skip to content

Proxy not working #424

Closed
Closed
@chrismcv

Description

@chrismcv

Hi,

I'm using the following configuration, and running webpack-dev-server --content-base public

  proxy: {
    '/api/*': {
      target: 'http://localhost:4907',
      rewrite: function(req) {
        console.log(req)
        req.url = req.url.replace(/^\/api/, '');
      }
    }
  },

All requests e.g. /api/user/current have a 404 response, and my console.log never fires. Is there some other part of the config that I'd need to change?

Thanks,
Chris

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions