Skip to content

Commit

Permalink
update cross origin for web access
Browse files Browse the repository at this point in the history
  • Loading branch information
kiblykat committed May 18, 2024
1 parent 6c54488 commit deb2555
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@

@RestController
@RequestMapping("/customers")
@CrossOrigin(origins = "http://localhost:5173")
// @CrossOrigin(origins = "http://localhost:5173")
@CrossOrigin(origins = "http://localhost:5173","${ALLOWED_ORIGIN}")
public class CustomerController {
private CustomerService customerService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

@RestController
@RequestMapping("/products")
@CrossOrigin(origins = "http://localhost:5173")
// @CrossOrigin(origins = "http://localhost:5173")
@CrossOrigin(origins = "http://localhost:5173","${ALLOWED_ORIGIN}")
public class ProductController {
private ProductService productService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

@RestController
@RequestMapping("/reviews")
@CrossOrigin(origins = "http://localhost:5173")
// @CrossOrigin(origins = "http://localhost:5173")
@CrossOrigin(origins = "http://localhost:5173","${ALLOWED_ORIGIN}")
public class ReviewController {
private ReviewService reviewService;

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ spring.application.name=smart-inventory
# The default server port is 8080.
server.port=${PORT:9090}

ALLOWED_ORIGIN=https://the-review-room-latest.onrender.com
# Database Configuration.
# PostgreSQL.
spring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/the_review_room}
Expand Down

0 comments on commit deb2555

Please sign in to comment.