-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Description
Please fill out the below information:
- Your Windows build number: (Type
verat a Windows Command Prompt)
Microsoft Windows [Version 10.0.18956.1000]
- What you're doing and what's happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)
React front app
$ yarn start
Rails backend API
$ bundle exec rails s -b localhost -p 5000
- What's wrong / what should be happening instead:
I want to connect my rails API but I can't.
If I type IP directly I can connect the API from react.
like
$ bundle exec rails s -b 172.xx.xx.xx -p 5000
cors.rb
origins /localhost:\d+/, /172.xx.xx.xx:\d+/
curl is OK
$ curl localhost:5000/users/1
{"status":"SUCCESS", ... }
but react
GET http://localhost:5000/users/1
net::ERR_CONNECTION_REFUSED
I am sorry I can't speak English well.