We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e50800c commit 53ccdfcCopy full SHA for 53ccdfc
Spring_Boot/CORS/README.md
@@ -0,0 +1,25 @@
1
+### CORS In Spring Boot
2
+
3
4
5
+```java
6
+package com.starter.springboot;
7
8
+import org.springframework.context.annotation.Configuration;
9
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
10
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
11
12
+@Configuration
13
+public class AppConf implements WebMvcConfigurer {
14
15
+ @Override
16
+ public void addCorsMappings(CorsRegistry registry) {
17
+ //enabling CORS
18
+ registry.addMapping("/**")
19
+ //setting the allowed origin
20
+ .allowedOrigins("http://localhost:4200")
21
+ //setting the allowed request Method
22
+ .allowedMethods("GET");
23
+ }
24
+}
25
+```
0 commit comments