Im working on my ow n project Im creating a registration form using react . Im using axios to make all the http requests and node js and express for the backend . Im trying to test out my app by trying to register a user account basically make a post request but i keep getting this error . Ive tried uninstalling and reinstalling chrome , I tried changing the headers to allow all request methods , I tried turning off the firewall security on my browser , ive shut down my app and restarted it in vs code multiple times even looked on youtube and nothing Ive tried so far has worked im not sure what the isssue is can someone try to help me figure out .
the likn to my repo is below if you want to view my code.
https://github.com/devonz1/Mern-Auth/tree/main/server
I think - though I’m no expert in Express / JS - that some of the options you’re passing to cors()
are wrong, but I would imagine that will just result in it applying the defaults of {origin: '*', methods: 'GET,HEAD,PUT,PATCH,POST,DELETE'}
.
The obvious question to ask is… is there definitely something running on localhost:8000 to handle the POST
request? CONNECTION_REFUSED would suggest there isn’t.