Skip to content

Commit 8c2d526

Browse files
Configured CORS, disabled Swagger
1 parent a903d48 commit 8c2d526

25 files changed

+207
-746
lines changed

.factorypath

Lines changed: 59 additions & 74 deletions
Large diffs are not rendered by default.

logs/application.log

Lines changed: 134 additions & 662 deletions
Large diffs are not rendered by default.

logs/application.log.2022-06-15.0.gz

-1.73 KB
Binary file not shown.

logs/application.log.2022-06-28.0.gz

2.77 KB
Binary file not shown.

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<parent>
1414
<groupId>org.springframework.boot</groupId>
1515
<artifactId>spring-boot-starter-parent</artifactId>
16-
<version>2.5.2</version>
16+
<version>2.6.6</version>
1717
</parent>
1818

1919
<properties>
@@ -48,18 +48,18 @@
4848
<optional>true</optional>
4949
</dependency>
5050

51-
<!-- Production Grade API Documentation Tool -->
51+
<!-- Production Grade API Documentation Tool
5252
<dependency>
5353
<groupId>io.springfox</groupId>
5454
<artifactId>springfox-swagger2</artifactId>
5555
<version>2.9.2</version>
5656
</dependency>
57-
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
5857
<dependency>
5958
<groupId>io.springfox</groupId>
6059
<artifactId>springfox-swagger-ui</artifactId>
6160
<version>2.9.2</version>
6261
</dependency>
62+
-->
6363

6464
<dependency>
6565
<groupId>org.springframework.boot</groupId>

src/main/java/com/swarna/courseapi/CourseApiApp.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
55
import org.springframework.cache.annotation.EnableCaching;
66

7-
import springfox.documentation.swagger2.annotations.EnableSwagger2;
7+
//import springfox.documentation.swagger2.annotations.EnableSwagger2;
88

99
@SpringBootApplication //annotation to tell Spring , this is a Boot Application
10-
@EnableSwagger2 // Enabling Swagger so that it can run
10+
//@EnableSwagger2 // Enabling Swagger so that it can run
1111
@EnableCaching //Enabling Caching
1212
public class CourseApiApp {
1313

src/main/java/com/swarna/courseapi/config/CorsConfig.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
@Configuration
99
public class CorsConfig implements WebMvcConfigurer{
1010

11-
@Value("${frontendURL}")
12-
private String frontendURL;
11+
// @Value("${frontendURL}")
12+
// private String frontendURL;
1313

1414
@Override
1515
public void addCorsMappings(CorsRegistry registry) {
1616
// WebMvcConfigurer.super.addCorsMappings(registry);
17-
registry.addMapping("/**").allowedOrigins(frontendURL)
17+
// registry.addMapping("/**").allowedOrigins(frontendURL)
18+
registry.addMapping("/**").allowedOrigins("*")
1819
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS");
1920
}
2021
}

src/main/java/com/swarna/courseapi/course/CourseRepository.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package com.swarna.courseapi.course;
22

33
import java.util.List;
4+
5+
// org.springframework.data.repository.Repository
46
import org.springframework.data.repository.CrudRepository;
57
import org.springframework.stereotype.Repository;
68

9+
710
@Repository
811
public interface CourseRepository extends CrudRepository<Course, String> {
912

src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
server.port=8080
22
spring.main.allow-bean-definition-overriding=true
3-
frontendURL=http://localhost:4200
3+
# frontendURL=http://localhost:4200
44
# frontendURL=
55

66
#Spring Data JPA config

target/classes/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
server.port=8080
22
spring.main.allow-bean-definition-overriding=true
3-
frontendURL=http://localhost:4200
3+
# frontendURL=http://localhost:4200
44
# frontendURL=
55

66
#Spring Data JPA config
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)