Spaces:
Sleeping
Sleeping
| package com.krishna.config; | |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.context.annotation.Configuration; | |
| import org.springframework.web.servlet.config.annotation.CorsRegistry; | |
| import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | |
| public class WebConfig { | |
| public WebMvcConfigurer corsConfigurer() { | |
| return new WebMvcConfigurer() { | |
| public void addCorsMappings(CorsRegistry registry) { | |
| registry.addMapping("/**") | |
| .allowedOrigins( | |
| "http://127.0.0.1:5500", | |
| "http://localhost:5173", | |
| "https://my-media-718.netlify.app" | |
| ) | |
| .allowedMethods("*") | |
| .allowedHeaders("*") | |
| .allowCredentials(true); | |
| } | |
| }; | |
| } | |
| } |