Skip to content
Snippets Groups Projects

javadoc and testclasses for backend

Merged Heine Mærde Brakstad requested to merge addition into main
65 files
+ 3184
280
Compare changes
  • Side-by-side
  • Inline
Files
65
@@ -4,13 +4,22 @@ import org.springframework.context.annotation.Configuration;
@@ -4,13 +4,22 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
/**
 
* Configuration class for CORS (Cross-Origin Resource Sharing).
 
*/
@Configuration
@Configuration
public class CorsConfig implements WebMvcConfigurer {
public class CorsConfig implements WebMvcConfigurer {
 
 
/**
 
* Adds CORS mapping configuration.
 
*
 
* @param registry CorsRegistry instance to configure CORS mappings.
 
*/
@Override
@Override
public void addCorsMappings(CorsRegistry registry) {
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
registry.addMapping("/**")
.allowedOrigins("http://localhost:5173")
.allowedOrigins("http://localhost:5173")
.allowedMethods("GET", "POST", "PUT", "DELETE")
.allowedMethods("GET", "POST", "PUT", "DELETE")
.allowedHeaders("*");
.allowedHeaders("*");
}
}
}
}
Loading