Package vaultWeb.config
Class CorsConfig
java.lang.Object
vaultWeb.config.CorsConfig
Global CORS configuration Source for the application.
This configuration allows the frontend application running on a different origin (e.g., http://localhost:4200) to make HTTP requests to the backend without being blocked by the browser's same-origin policy.
It allows all HTTP methods, headers, and credentials to be sent.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.cors.CorsConfigurationSourceDefines a CORS Configuration source that applies the CORS configuration to all endpoints.
-
Constructor Details
-
CorsConfig
public CorsConfig()
-
-
Method Details
-
corsConfigurationSource
@Bean public org.springframework.web.cors.CorsConfigurationSource corsConfigurationSource()Defines a CORS Configuration source that applies the CORS configuration to all endpoints.- Returns:
- CorsFilter instance that intercepts requests and adds necessary CORS headers for allowed origins, methods, headers, and credentials.
-