Skip to content

Commit

Permalink
Updated the environment variable used to a custom variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
nhkhai committed May 18, 2024
1 parent 44dd07b commit 6fb6107
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
@RestController
@RequestMapping("/customers")
// @CrossOrigin(origins = "http://localhost:5173")
@CrossOrigin(origins = "${server.address}")
@CrossOrigin(origins = "${frontend.server.address}")
public class CustomerController {

private CustomerService customerService;

// @Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
@RestController
@RequestMapping("/products")
// @CrossOrigin(origins = "http://localhost:5173")
@CrossOrigin(origins = "${server.address}")
@CrossOrigin(origins = "${frontend.server.address}")
public class ProductController {
private ProductService productService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@RestController
@RequestMapping("/reviews")
// @CrossOrigin(origins = "http://localhost:5173")
@CrossOrigin(origins = "${server.address}")
@CrossOrigin(origins = "${frontend.server.address}")
public class ReviewController {
private ReviewService reviewService;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"properties": [
{
"name": "frontend.server.address",
"type": "java.lang.String",
"description": "The frontend server address. "
}
]
}
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spring.application.name=smart-inventory

# Server CORS Configuration.
server.address=${ADDRESS:http://localhost:5173}
frontend.server.address=${ADDRESS:http://localhost:5173}

# Server Port Configuration.
# The default server port is 8080.
Expand Down

0 comments on commit 6fb6107

Please sign in to comment.