move cors to the Config
Some checks failed
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Has been cancelled

This commit is contained in:
Lee
2024-04-13 14:07:54 +01:00
parent 52d89a6d9f
commit 586539d810
2 changed files with 19 additions and 14 deletions

View File

@ -40,18 +40,4 @@ public class Main {
SpringApplication.run(Main.class, args); // Start the application
}
@Bean
public WebMvcConfigurer configureCors() {
return new WebMvcConfigurer() {
@Override
public void addCorsMappings(@NonNull CorsRegistry registry) {
// Allow all origins to access the API
registry.addMapping("/**")
.allowedOrigins("*") // Allow all origins
.allowedMethods("*") // Allow all methods
.allowedHeaders("*"); // Allow all headers
}
};
}
}