Skip to content
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

URL parameters behind a variable #47

Closed
rottmann opened this issue Apr 16, 2015 · 3 comments
Closed

URL parameters behind a variable #47

rottmann opened this issue Apr 16, 2015 · 3 comments

Comments

@rottmann
Copy link

this will work (with / behind var1)
/some/path/:var1/?fixed_var=fixed_value

this not
/some/path/:var1?fixed_var=fixed_value

@blakeembrey
Copy link
Member

@rottmann This library was never intended to even parse a string with query parameters. I'll need some more information to work this out though. What is the path/options you are using and what is the intended behaviour?

@rottmann
Copy link
Author

Using the lib in my apidoc project
https://github.com/apidoc/apidoc/

An example output is here: http://apidocjs.com/example/
You can send a sample request to an url, the url can have the :params

@weikinhuang report an issue apidoc/apidoc#226 because he use urls with :params and ?variables....

@blakeembrey
Copy link
Member

You can use a backslash to escape the question mark, but it's an optional flag for params (https://github.com/pillarjs/path-to-regexp#optional).

eheikes added a commit to Banno/node-mock-rest-middleware that referenced this issue May 18, 2016
See also pillarjs/path-to-regexp#47

We're using a hack to include query parameters, because params aren't
officially supported by path-to-regexp.
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

No branches or pull requests

2 participants