Skip to content
Snippets Groups Projects
Commit ddb04f7a authored by Byron Biggs's avatar Byron Biggs
Browse files

Merge branch 'revert-c086cfcc' into 'main'

Revert "Added WebConfig file (for api)"

See merge request !6
parents 6ac5e59a ffbd83f3
Branches
No related tags found
1 merge request!6Revert "Added WebConfig file (for api)"
package com.example.demo.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/api/**")
.allowedOrigins("*") // Allow any origin - replace with specific origins in production
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
.allowedHeaders("*")
.maxAge(3600); // 1 hour cache for CORS preflight requests
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment