lwsjs / local-web-server

A lean, modular web server for rapid full-stack development.
MIT License
1.22k stars 86 forks source link

Mocking with request parameters #101

Closed vishvodhay closed 6 years ago

vishvodhay commented 6 years ago

I'm trying to construct an endpoint/route which takes in query string params and mocks do not respond to those requests

/v1/api/type?keyword=abc

It's only capable to read until "/v1/api/type" and ignore the rest. How can I leverage query params in mocking with lws?

75lb commented 6 years ago

within your middleware function, the query string params should be available on ctx.request.query..