📜  spring cors - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:49.733000             🧑  作者: Mango

代码示例3
public WebMvcConfigurer corsConfigurer() {
        return new WebMvcConfigurer() {
            @Override
            public void addCorsMappings(CorsRegistry registry) {
                registry.addMapping("/greeting-javaconfig").allowedOrigins("http://localhost:9000");
            }
        };
    }Copy