stackoverflow-clone
stackoverflow-clone copied to clipboard
Get Cors error while trying first setup
Seems server side not started successfully
Unhandled Runtime Error Error: Network Error
Call Stack createError node_modules/axios/lib/core/createError.js (16:0) XMLHttpRequest.handleError node_modules/axios/lib/adapters/xhr.js (83:0)
a-nai@a-nai:~/stackoverflow-clone/server$ sudo npm run start
[email protected] start /home/a-nai/stackoverflow-clone/server node index.js
at http://84.201.145.163:8080 i get {"message":"Not found"}
This {"message":"Not found"} result is normal. No problem beacause server not have any root your link.
You can follow the steps below as an example to try it working.
- Use any postman etc tools and post data localhost:8080/api/signup link adress with value of body username and password.
- Then use see all of users localhost:8080/api/users that link adress.
The Database mongodb empty - may it reason for error? http://84.201.145.163:3000 - at this address i have error Unhandled Runtime Error Error: Network Error
Call Stack createError node_modules/axios/lib/core/createError.js (16:0) XMLHttpRequest.handleError node_modules/axios/lib/adapters/xhr.js (83:0)
I found this https://stackoverflow.com/questions/58790057/network-error-on-posting-a-request-using-axios question - and answer "The problem is resolved,I was using wrong IP(172.0.0.1) given by hostname --ip-address. Using the inet ip given by ip addr show works." - but not understand what that means!!!!
I do firewall disable
sudo ufw disable
but error persist
- :8080/api/signup
CORS Error: The request has been blocked because of the CORS policy when i do request via postman web - to - https://84.201.145.163:8080/api/signup
and
Mixed Content Error: The request has been blocked because it requested an insecure HTTP resource when i do request via postman web - to - http://84.201.145.163:8080/api/signup
at https://web.postman.co/workspace/c35a90b7-4bfd-4a9b-8907-4b9a33372a2e/request/create?requestId=ac01fcc0-46f6-4e9b-860c-e544d47789e7
Still waiting for resolution. May be try other fork?