cors
This commit is contained in:
@@ -2,8 +2,10 @@ package konturai.kz.api_gateway;
|
|||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
@ComponentScan(basePackages = "konturai.kz.api_gateway")
|
||||||
public class ApiGatewayApplication {
|
public class ApiGatewayApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ import reactor.core.publisher.Mono;
|
|||||||
@Component
|
@Component
|
||||||
public class CorsHeaderFilter implements GlobalFilter, Ordered {
|
public class CorsHeaderFilter implements GlobalFilter, Ordered {
|
||||||
|
|
||||||
|
public CorsHeaderFilter() {
|
||||||
|
System.out.println("CorsHeaderFilter created and registered!");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
||||||
ServerHttpRequest request = exchange.getRequest();
|
ServerHttpRequest request = exchange.getRequest();
|
||||||
|
|||||||
Reference in New Issue
Block a user