#Cross Origin using API-Gateway and angular

6 messages · Page 1 of 1 (latest)

hushed meteor
#

Hello i have a probleme i have a micrservice demo app when i try to send http request (post , put , delete) from my angular app i got the cross origin error i tried many solution on my application.yaml any solution please ? : yml spring: cloud: gateway: routes: - id: r1 uri: http://localhost:8000/ predicates: - Path=/products/** - id: r2 uri: http://localhost:8001/ predicates: - Path=/orders/** - id: r3 uri: http://localhost:8002/ predicates: - Path=/inventory/** discovery: enabled: false server: port: 8888

rotund stratusBOT
#

This post has been reserved for your question.

Hey @hushed meteor! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

orchid rain
#

allow cors requests

#
    @Bean
    public WebMvcConfigurer corsConfigurer() {
        return new WebMvcConfigurer() {
            @Override
            public void addCorsMappings(CorsRegistry registry) {
                registry.addMapping("/greeting-javaconfig").allowedOrigins("http://localhost:8080");
            }
        };
    }```