Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7536271

Browse files
authored
Add CORS settings to application.properties
Added CORS configuration for allowed origins, methods, headers, and credentials.
1 parent f60cb62 commit 7536271

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# application.properties
22
spring.application.name=java-api
33
spring.data.mongodb.uri=${MONGODB_URI}
4-
spring.data.mongodb.database=${MONGODB_DATABASE}
4+
spring.data.mongodb.database=${MONGODB_DATABASE}
5+
cors.allowed-origins=https://danielvor.onrender.com,https://danielvor.vercel.app,http://localhost:3000
6+
cors.allowed-methods=GET,POST,PUT,DELETE,OPTIONS
7+
cors.allowed-headers=*
8+
cors.allow-credentials=true

0 commit comments

Comments
 (0)