title: How to configure JSON Server to support specific query string parameters?
body: <p>I checked the json server to add configuration: <a href="https://github.com/typicode/json-server/#add-custom-routes" rel="nofollow noreferrer">https://github.com/typicode/json-server/#add-custom-routes</a></p>
  
  <p>Cause I would like to add the support for query string parameters in my application in the development environment.</p>
  
  <p><code>routes.json</code>:</p>
  
  <pre><code>{
      "/api/v1/*": "/$1",
  }
  </code></pre>
  
  <p><code>/api-faked/db.json</code>:</p>
  
  <pre><code>{
      "operations?code=": [{"operationCode":"ADIDAS96"},{"operationCode":"ADIDAS99"},{"operationCode":"ADIDAS101"}],
      "operations?code=adi": [{"operationCode":"ADIDAS96"},{"operationCode":"ADIDAS99"},{"operationCode":"ADIDAS101"}],
      "operations?code=adid": [{"operationCode":"ADIDAS96"},{"operationCode":"ADIDAS99"},{"operationCode":"ADIDAS101"}],
      "operations?code=adida": [{"operationCode":"ADIDAS96"},{"operationCode":"ADIDAS99"},{"operationCode":"ADIDAS101"}],
      "operations?code=adidas": [{"operationCode":"ADIDAS96"},{"operationCode":"ADIDAS99"},{"operationCode":"ADIDAS101"}],
      "operations?code=adidas1": [{"operationCode":"ADIDAS101"}],
      "operations?code=adidas10": [{"operationCode":"ADIDAS101"}],
      "operations?code=adidas101": [{"operationCode":"ADIDAS101"}],
      "operations?code=adidas9": [{"operationCode":"ADIDAS96"},{"operationCode":"ADIDAS99"}],
      "operations?code=adidas96": [{"operationCode":"ADIDAS96"}],
      "operations?code=adidas99": [{"operationCode":"ADIDAS99"}],
  }
  </code></pre>
  
  <p>The application is run with:</p>
  
  <pre><code>{
    "name": "rm-combo",
    "version": "0.1.0",
    "private": true,
    "scripts": {
      "serve": "concurrently -k \"json-server --watch api-faked/db.json --routes api-faked/routes.json --ro\" \"vue-cli-service serve\"",
      "build": "vue-cli-service build",
      "lint": "vue-cli-service lint"
    },
    ...
  </code></pre>
  
  <p>when starting the application:</p>
  
  <pre><code>[1]  INFO  Starting development server...
  [0]
  [0]   \{^_^}/ hi!
  [0]
  [0]   Loading api-faked/db.json
  [0]   Loading api-faked/routes.json
  [0]   Done
  [0]
  [0]   Resources
  [0]   http://localhost:3000/operations?code=
  [0]   http://localhost:3000/operations?code=adi
  [0]   http://localhost:3000/operations?code=adid
  [0]   http://localhost:3000/operations?code=adida
  [0]   http://localhost:3000/operations?code=adidas
  [0]   http://localhost:3000/operations?code=adidas1
  [0]   http://localhost:3000/operations?code=adidas10
  [0]   http://localhost:3000/operations?code=adidas101
  [0]   http://localhost:3000/operations?code=adidas9
  [0]   http://localhost:3000/operations?code=adidas96
  [0]   http://localhost:3000/operations?code=adidas99
  ...
  </code></pre>
  
  <p>The thing that is kinda weird is two folded, the resources above shows that there is no <code>/api/v1/</code> segment in the resources generated by the JSON Server.</p>
  
  <p>So obviously when I perform GET operations on the endpoints like:</p>
  
  <p><code>http://localhost:3000/api/v1/operations?code=</code> or 
  <code>http://localhost:3000/operations?code=adidas1</code> I am getting a 404.</p>
  
  <p>But if I am adding to <code>db.json</code>:</p>
  
  <p><code>"operations": [{"operationCode":"ADIDAS96"},{"operationCode":"ADIDAS99"},{"operationCode":"ADIDAS101"}],</code></p>
  
  <p>Then any GET request on <code>/api/v1/operations?code=whatever</code> will return (regardless of the <code>code</code> query string) will return the object given in <code>operations</code> in <code>db/json</code>.</p>
  
  <p>How can I have a JSON server running which respects the query string configuration given in <code>/api-faked/db.json</code>, that is that:</p>
  
  <p><code>/api/v1/operations?code=adidas101</code> and <code>/api/v1/operations?code=adidas99</code> return two different results. </p>