gothinkster / spring-boot-realworld-example-app

Example Spring codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld API spec.
MIT License
1.31k stars 680 forks source link

spring cors does not setup properly #1

Closed luvlee-liu closed 7 years ago

luvlee-liu commented 7 years ago

run with https://github.com/gothinkster/react-redux-realworld-example-app get follow error in chrome console

Failed to load http://localhost:8080/api/user: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4100' is therefore not allowed access. The response had HTTP status code 401.

aisensiy commented 7 years ago

This is an issue mentioned in https://github.com/spring-projects/spring-boot/issues/5834. Already fixed it. 😃

And you should change the src/agent.js file in the front-end part, update the entry point to http://localhost:8080 without the /api prefix.