Updated CORS

This commit is contained in:
Matthew Ellison
2024-04-15 16:56:59 -04:00
parent 2a84f53873
commit fcc04b3416
2 changed files with 22 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
package com.mattrixwv.cipherstream.config;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Component
@EnableWebMvc
public class WebConfig implements WebMvcConfigurer{
@Override
public void addCorsMappings(@NonNull CorsRegistry registry){
registry.addMapping("/**")
.allowedOriginPatterns("http://localhost:3000");
}
}