File tree Expand file tree Collapse file tree 5 files changed +710
-653
lines changed
java/com/mycompany/orderapi/config Expand file tree Collapse file tree 5 files changed +710
-653
lines changed Original file line number Diff line number Diff line change 5
5
<parent >
6
6
<groupId >org.springframework.boot</groupId >
7
7
<artifactId >spring-boot-starter-parent</artifactId >
8
- <version >2.4.1 </version >
8
+ <version >2.4.3 </version >
9
9
<relativePath /> <!-- lookup parent from repository -->
10
10
</parent >
11
11
17
17
18
18
<properties >
19
19
<java .version>11</java .version>
20
- <jjwt .version>0.11.1 </jjwt .version>
21
- <org .mapstruct.version>1.4.1 .Final</org .mapstruct.version>
22
- <springdoc .openapi.version>1.5.1 </springdoc .openapi.version>
20
+ <jjwt .version>0.11.2 </jjwt .version>
21
+ <org .mapstruct.version>1.4.2 .Final</org .mapstruct.version>
22
+ <springdoc .openapi.version>1.5.5 </springdoc .openapi.version>
23
23
</properties >
24
24
25
25
<dependencies >
100
100
<plugin >
101
101
<groupId >org.springframework.boot</groupId >
102
102
<artifactId >spring-boot-maven-plugin</artifactId >
103
+ <configuration >
104
+ <excludes >
105
+ <exclude >
106
+ <groupId >org.projectlombok</groupId >
107
+ <artifactId >lombok</artifactId >
108
+ </exclude >
109
+ </excludes >
110
+ </configuration >
103
111
</plugin >
104
112
<plugin >
105
113
<groupId >org.apache.maven.plugins</groupId >
106
114
<artifactId >maven-compiler-plugin</artifactId >
107
115
<configuration >
108
116
<annotationProcessorPaths >
109
- <!-- Lombok -->
110
117
<path >
111
118
<groupId >org.projectlombok</groupId >
112
119
<artifactId >lombok</artifactId >
113
120
<version >${lombok.version} </version >
114
121
</path >
115
- <!-- MapStruct -->
116
122
<path >
117
123
<groupId >org.mapstruct</groupId >
118
124
<artifactId >mapstruct-processor</artifactId >
Original file line number Diff line number Diff line change 1
1
package com .mycompany .orderapi .config ;
2
2
3
3
import java .util .Collections ;
4
+ import java .util .List ;
4
5
6
+ import org .springframework .beans .factory .annotation .Value ;
5
7
import org .springframework .context .annotation .Bean ;
6
8
import org .springframework .context .annotation .Configuration ;
7
9
import org .springframework .web .cors .CorsConfiguration ;
12
14
public class CorsConfig {
13
15
14
16
@ Bean
15
- CorsFilter corsFilter () {
17
+ CorsFilter corsFilter (@ Value ( "${app.cors.allowed-origins}" ) List < String > allowedOrigins ) {
16
18
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource ();
17
19
CorsConfiguration config = new CorsConfiguration ();
18
20
config .setAllowCredentials (true );
19
- config .setAllowedOrigins (Collections . singletonList ( "http://localhost:3000" ) );
21
+ config .setAllowedOrigins (allowedOrigins );
20
22
config .setAllowedMethods (Collections .singletonList ("*" ));
21
23
config .setAllowedHeaders (Collections .singletonList ("*" ));
22
24
source .registerCorsConfiguration ("/**" , config );
Original file line number Diff line number Diff line change 16
16
secret : v9y$B&E)H@MbQeThWmZq4t7w!z%C*F-JaNdRfUjXn2r5u8x/A?D(G+KbPeShVkYp
17
17
expiration :
18
18
minutes : 10
19
+ cors :
20
+ allowed-origins : http://localhost:3000
You can’t perform that action at this time.
0 commit comments