Completed first revision of front end. Enabled CORS in spring. Allowed path variable to be optional.
This commit is contained in:
parent
c160703048
commit
e5a84268cc
11 changed files with 456 additions and 328 deletions
backend/src/main/java/achievements
|
@ -3,6 +3,9 @@ package achievements;
|
|||
import achievements.services.DbConnectionService;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@SpringBootApplication
|
||||
public class Application {
|
||||
|
@ -16,4 +19,16 @@ public class Application {
|
|||
SpringApplication.exit(context, () -> 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Bean
|
||||
public WebMvcConfigurer configurer() {
|
||||
return new WebMvcConfigurer() {
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry
|
||||
.addMapping("/*")
|
||||
.allowedOrigins("*");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue