Skip to content

added support for regex in proxy options #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

jamon
Copy link

@jamon jamon commented Apr 5, 2015

provide configurations where the path is a regular expression, eg:

        proxy: [
            {
                path: /\/google(.*)/,
                target: "http://www.google.com/"
            }
        ],

provide configurations where the path is a regular expression, eg:
        proxy: [
            {
                path: /\/google(.*)/,
                target: "http://www.google.com/"
            }
        ],
@jamon jamon changed the title added support for options.proxy as an array. This will allow you to added support for regex in proxy options Apr 5, 2015
return ({
path: path,
target: typeof options.proxy[path] === "string" ? options.proxy[path] : options.proxy[path].target
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part should be moved into lib/Server.js to allow this config style without the CLI too.

@AprilArcus
Copy link

This would be super useful for us! We are working on a mock server that has to support a very heterogenous legacy route scheme, and we'd like to be able to white-list certain routes and proxy the rest.

@sokra
Copy link
Member

sokra commented May 5, 2015

@AprilArcus take a look at the note, fix it and create another PR.

@ntharim
Copy link
Contributor

ntharim commented May 26, 2015

I fixed this in #187. Please a have look.

@PavelGavlik
Copy link

Shouldn't we close this PR when #187 has superseded this PR and it has been merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants