salihozdemir / stackoverflow-clone

This project is a simplified a full stack clone of Stackoverflow.
https://clone-of-stackoverflow.vercel.app
MIT License
673 stars 183 forks source link

Get Cors error while trying first setup #11

Open a-nai opened 3 years ago

a-nai commented 3 years ago

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

stackoverflow-api@1.0.0 start /home/a-nai/stackoverflow-clone/server node index.js

at http://84.201.145.163:8080 i get {"message":"Not found"}

salihozdemir commented 3 years ago

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.

a-nai commented 3 years ago

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!!!!

a-nai commented 3 years ago

I do firewall disable

sudo ufw disable

but error persist

a-nai commented 3 years ago
  • :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

a-nai commented 3 years ago

Still waiting for resolution. May be try other fork?