DEV Community

Discussion on: jSON Server with ReactJS

Collapse
 
stefanvrecic profile image
StefanVrecic

If your client is on 3000 and your API is on 3001, do you not get a 403 error? I'm doing a little job takehome test and I've been provided with the server/API which I'm not allowed to edit, it's using JSON-server.

Whenever I run my client and API, one of them goes on 3002 (or I could specify a different port) - they can't run on the same port, and also trying to access localhost:3002/api returns a 403 error, which I'm assuming is because cors is not enabled. How does yours work?

Collapse
 
q118 profile image
Shelby Anne

You just need to open another console window and run both commands at the same time. One for 3000 and one for 3001 :)