@@ -29,19 +29,19 @@ server.port=8080
2929server.servlet.context-path=/${projectName.lowercase()}
3030
3131# H2 Database Configuration
32- spring.datasource.url=jdbc:h2:mem:${' $' } {DB_NAME}
32+ spring.datasource.url=jdbc:h2:mem:${' $' } {DB_NAME:testdb }
3333spring.datasource.driverClassName=org.h2.Driver
34- spring.datasource.username=${' $' } {DB_USERNAME}
35- spring.datasource.password=${' $' } {DB_PASSWORD}
34+ spring.datasource.username=${' $' } {DB_USERNAME:sa }
35+ spring.datasource.password=${' $' } {DB_PASSWORD: }
3636spring.h2.console.enabled=true
3737spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
3838spring.jpa.hibernate.ddl-auto=create-drop
3939spring.jpa.show-sql=true
4040
4141# CORS Configuration (Environment-based for security)
42- cors.allowed-origins=${' $' } {ALLOWED_ORIGINS}
43- cors.allowed-methods=${' $' } {ALLOWED_METHODS}
44- cors.allowed-headers=${' $' } {ALLOWED_HEADERS}
42+ cors.allowed-origins=${' $' } {ALLOWED_ORIGINS:* }
43+ cors.allowed-methods=${' $' } {ALLOWED_METHODS:GET,POST,PUT,DELETE,OPTIONS,PATCH }
44+ cors.allowed-headers=${' $' } {ALLOWED_HEADERS:Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since }
4545cors.max-age=${' $' } {CORS_MAX_AGE:3600}
4646""" .trimIndent()
4747
@@ -53,18 +53,18 @@ server.port=8080
5353server.servlet.context-path=/${projectName.lowercase().trim()}
5454
5555# MySQL Database Configuration
56- spring.datasource.url=jdbc:mysql://localhost:3306/${' $' } {DB_NAME}
57- spring.datasource.username=${' $' } {DB_USERNAME}
58- spring.datasource.password=${' $' } {DB_PASSWORD}
56+ spring.datasource.url=jdbc:mysql://localhost:3306/${' $' } {DB_NAME:testdb }
57+ spring.datasource.username=${' $' } {DB_USERNAME:root }
58+ spring.datasource.password=${' $' } {DB_PASSWORD:password }
5959spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
6060spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
6161spring.jpa.hibernate.ddl-auto=update
6262spring.jpa.show-sql=true
6363
6464# CORS Configuration (Environment-based for security)
65- cors.allowed-origins=${' $' } {ALLOWED_ORIGINS}
66- cors.allowed-methods=${' $' } {ALLOWED_METHODS}
67- cors.allowed-headers=${' $' } {ALLOWED_HEADERS}
65+ cors.allowed-origins=${' $' } {ALLOWED_ORIGINS:* }
66+ cors.allowed-methods=${' $' } {ALLOWED_METHODS:GET,POST,PUT,DELETE,OPTIONS,PATCH }
67+ cors.allowed-headers=${' $' } {ALLOWED_HEADERS:Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since }
6868cors.max-age=${' $' } {CORS_MAX_AGE:3600}
6969""" .trimIndent()
7070
@@ -76,18 +76,18 @@ server.port=8080
7676server.servlet.context-path=/${projectName.lowercase().trim()}
7777
7878# MariaDB Database Configuration
79- spring.datasource.url=jdbc:mariadb://localhost:3306/${' $' } {DB_NAME}
80- spring.datasource.username=${' $' } {DB_USERNAME}
81- spring.datasource.password=${' $' } {DB_PASSWORD}
79+ spring.datasource.url=jdbc:mariadb://localhost:3306/${' $' } {DB_NAME:testdb }
80+ spring.datasource.username=${' $' } {DB_USERNAME:root }
81+ spring.datasource.password=${' $' } {DB_PASSWORD:password }
8282spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
8383spring.jpa.database-platform=org.hibernate.dialect.MariaDBDialect
8484spring.jpa.hibernate.ddl-auto=update
8585spring.jpa.show-sql=true
8686
8787# CORS Configuration (Environment-based for security)
88- cors.allowed-origins=${' $' } {ALLOWED_ORIGINS}
89- cors.allowed-methods=${' $' } {ALLOWED_METHODS}
90- cors.allowed-headers=${' $' } {ALLOWED_HEADERS}
88+ cors.allowed-origins=${' $' } {ALLOWED_ORIGINS:* }
89+ cors.allowed-methods=${' $' } {ALLOWED_METHODS:GET,POST,PUT,DELETE,OPTIONS,PATCH }
90+ cors.allowed-headers=${' $' } {ALLOWED_HEADERS:Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since }
9191cors.max-age=${' $' } {CORS_MAX_AGE:3600}
9292""" .trimIndent()
9393
@@ -99,18 +99,18 @@ server.port=8080
9999server.servlet.context-path=/${projectName.lowercase().trim()}
100100
101101# PostgreSQL Database Configuration
102- spring.datasource.url=jdbc:postgresql://localhost:5432/${' $' } {DB_NAME}
103- spring.datasource.username=${' $' } {DB_USERNAME}
104- spring.datasource.password=${' $' } {DB_PASSWORD}
102+ spring.datasource.url=jdbc:postgresql://localhost:5432/${' $' } {DB_NAME:testdb }
103+ spring.datasource.username=${' $' } {DB_USERNAME:postgres }
104+ spring.datasource.password=${' $' } {DB_PASSWORD:password }
105105spring.datasource.driver-class-name=org.postgresql.Driver
106106spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
107107spring.jpa.hibernate.ddl-auto=update
108108spring.jpa.show-sql=true
109109
110110# CORS Configuration (Environment-based for security)
111- cors.allowed-origins=${' $' } {ALLOWED_ORIGINS}
112- cors.allowed-methods=${' $' } {ALLOWED_METHODS}
113- cors.allowed-headers=${' $' } {ALLOWED_HEADERS}
111+ cors.allowed-origins=${' $' } {ALLOWED_ORIGINS:* }
112+ cors.allowed-methods=${' $' } {ALLOWED_METHODS:GET,POST,PUT,DELETE,OPTIONS,PATCH }
113+ cors.allowed-headers=${' $' } {ALLOWED_HEADERS:Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since }
114114cors.max-age=${' $' } {CORS_MAX_AGE:3600}
115115""" .trimIndent()
116116
@@ -122,9 +122,9 @@ server.port=8080
122122server.servlet.context-path=/${projectName.lowercase().trim()}
123123
124124# CORS Configuration (Environment-based for security)
125- cors.allowed-origins=${' $' } {ALLOWED_ORIGINS}
126- cors.allowed-methods=${' $' } {ALLOWED_METHODS}
127- cors.allowed-headers=${' $' } {ALLOWED_HEADERS}
125+ cors.allowed-origins=${' $' } {ALLOWED_ORIGINS:* }
126+ cors.allowed-methods=${' $' } {ALLOWED_METHODS:GET,POST,PUT,DELETE,OPTIONS,PATCH }
127+ cors.allowed-headers=${' $' } {ALLOWED_HEADERS:Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since }
128128cors.max-age=${' $' } {CORS_MAX_AGE:3600}
129129""" .trimIndent()
130130}
0 commit comments