Completed first revision of front end. Enabled CORS in spring. Allowed path variable to be optional.

This commit is contained in:
Gnarwhal 2021-01-29 03:30:05 -05:00
parent c160703048
commit e5a84268cc
Signed by: Gnarwhal
GPG key ID: 0989A73D8C421174
11 changed files with 456 additions and 328 deletions
backend/src/main/java/achievements

View file

@ -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("*");
}
};
}
}