Skip to content

Instantly share code, notes, and snippets.

@bastienapp
Created June 29, 2026 07:52
Show Gist options
  • Select an option

  • Save bastienapp/e2856ee724c9cfb129fd2bcfc5756e20 to your computer and use it in GitHub Desktop.

Select an option

Save bastienapp/e2856ee724c9cfb129fd2bcfc5756e20 to your computer and use it in GitHub Desktop.
package co.simplon.springjwt.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 WebMvcConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://url-du-frontend-ici");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment