Skip to content

Support query params in rewrites #372

@ashleahhill

Description

@ashleahhill

I'm working on a project with composite ids for data entries. In order to query a particular record using JSON Server, I need to write a rewrite like this:

const rewrites = {
  '/records/:idpartone-:idparttwo/': '/records/?id.partone=:idpartone&id.parttwo=:idparttwo'
};

The rewriter correctly rewrites the url, however the new query params are not parsed. The end result is that a request to /records/:idpartone-:idparttwo/ will return the full set of /records/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions