-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated to java 19 and Spring 3.0.3, all working on localhost, winner…
… is webflux
- Loading branch information
armena
committed
Mar 13, 2023
1 parent
9473f17
commit 472e56a
Showing
28 changed files
with
328 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/reactivetomcat/target/ | ||
/webflux/target/ | ||
/undertow/target/ | ||
/tomcat/target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project-shared-configuration> | ||
<!-- | ||
This file contains additional configuration written by modules in the NetBeans IDE. | ||
The configuration is intended to be shared among all the users of project and | ||
therefore it is assumed to be part of version control checkout. | ||
Without this configuration present, some functionality in the IDE may be limited or fail altogether. | ||
--> | ||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1"> | ||
<!-- | ||
Properties that influence various parts of the IDE, especially code formatting and the like. | ||
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up. | ||
That way multiple projects can share the same settings (useful for formatting rules for example). | ||
Any value defined here will override the pom.xml file value but is only applicable to the current project. | ||
--> | ||
<netbeans.hint.jdkPlatform>Temurin_19.0.2_7</netbeans.hint.jdkPlatform> | ||
</properties> | ||
</project-shared-configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
reactivetomcat/src/main/java/io/project/app/CorsConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package io.project.sp; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.http.HttpHeaders; | ||
import org.springframework.http.server.reactive.ServerHttpRequest; | ||
import org.springframework.http.server.reactive.ServerHttpResponse; | ||
import org.springframework.web.cors.reactive.CorsUtils; | ||
import org.springframework.web.server.ServerWebExchange; | ||
import org.springframework.web.server.WebFilter; | ||
import org.springframework.web.server.WebFilterChain; | ||
|
||
/** | ||
* | ||
* @author armen | ||
*/ | ||
@Configuration | ||
public class CorsConfiguration { | ||
|
||
private static final String ALLOWED_HEADERS = "*"; | ||
private static final String ALLOWED_METHODS = "GET, PUT, POST, DELETE, OPTIONS, PATCH"; | ||
private static final String ALLOWED_ORIGIN = "*"; | ||
private static final String MAX_AGE = "7200"; | ||
|
||
@Bean | ||
public WebFilter corsFilter() { | ||
return (ServerWebExchange ctx, WebFilterChain chain) -> { | ||
ServerHttpRequest request = ctx.getRequest(); | ||
if (CorsUtils.isCorsRequest(request)) { | ||
ServerHttpResponse response = ctx.getResponse(); | ||
HttpHeaders headers = response.getHeaders(); | ||
headers.add("Access-Control-Allow-Origin", ALLOWED_ORIGIN); | ||
headers.add("Access-Control-Allow-Methods", ALLOWED_METHODS); | ||
headers.add("Access-Control-Max-Age", MAX_AGE); | ||
headers.add("Access-Control-Allow-Headers", ALLOWED_HEADERS); | ||
} | ||
return chain.filter(ctx); | ||
}; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
reactivetomcat/src/main/java/io/project/app/OpenApiConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.project.sp; | ||
|
||
import org.springdoc.core.models.GroupedOpenApi; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class OpenApiConfiguration { | ||
|
||
@Bean | ||
public GroupedOpenApi publicApi() { | ||
return GroupedOpenApi.builder() | ||
.group("publicapi") | ||
.packagesToScan("io.project") | ||
.pathsToMatch("/api/**") | ||
.build(); | ||
} | ||
|
||
} |
48 changes: 0 additions & 48 deletions
48
reactivetomcat/src/main/java/io/project/app/SwaggerConfig.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project-shared-configuration> | ||
<!-- | ||
This file contains additional configuration written by modules in the NetBeans IDE. | ||
The configuration is intended to be shared among all the users of project and | ||
therefore it is assumed to be part of version control checkout. | ||
Without this configuration present, some functionality in the IDE may be limited or fail altogether. | ||
--> | ||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1"> | ||
<!-- | ||
Properties that influence various parts of the IDE, especially code formatting and the like. | ||
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up. | ||
That way multiple projects can share the same settings (useful for formatting rules for example). | ||
Any value defined here will override the pom.xml file value but is only applicable to the current project. | ||
--> | ||
<netbeans.hint.jdkPlatform>Temurin_19.0.2_7</netbeans.hint.jdkPlatform> | ||
</properties> | ||
</project-shared-configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
tomcat/src/main/java/io/project/app/OpenApiConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.project.app; | ||
|
||
import org.springdoc.core.models.GroupedOpenApi; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class OpenApiConfiguration { | ||
|
||
@Bean | ||
public GroupedOpenApi publicApi() { | ||
return GroupedOpenApi.builder() | ||
.group("publicapi") | ||
.packagesToScan("io.project") | ||
.pathsToMatch("/api/**") | ||
.build(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.