title: no cors config not working with json-server
body: <p>I'm using <a href="https://github.com/typicode/json-server" rel="nofollow noreferrer">json-server</a> to create a mock API of my actual API for offline testing purpose.
  I can see the mock API response under their Url endpoint:
  <code>localhost:5001/api/searchresults/*</code></p>
  <p>but on my app I cannot see the results because the request is blocked by CORS.
  Reading the json-server docu, there is a way to disable CORS issues, adding <code>jsonServer.defaults({ noCors: true })</code> as middleware.</p>
  <p>I than add a custom server and run this with node server.js</p>
  <pre><code>// server.js
  const jsonServer = require('json-server')
  const server = jsonServer.create()
  const router = jsonServer.router('db.json')
  const middlewares = jsonServer.defaults({ noCors: true })
  
  server.use(middlewares)
  
  server.use('/api/searchresults', router)
  server.listen(5001, () =&gt; {
    console.log('Mock api server listening at localhost:5001')
  })
  
  </code></pre>
  <p>but unfortunately I still get cors issues when try to fetch my data.</p>
  <p>Anyone has an idea why is not working or how to address this problem?</p>
  <p>Here is the full project: <a href="https://github.com/ElliotForWater/efw-webapp" rel="nofollow noreferrer">https://github.com/ElliotForWater/efw-webapp</a></p>