From b6e97d47a200de3cece4517dcbf45f8e2f35b866 Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Thu, 19 Sep 2024 00:07:27 -0400 Subject: [PATCH] yes? --- Dockerfile | 2 +- src/main/java/cc/pulseapp/api/PulseAPI.java | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index a1e7fae..7f37571 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ WORKDIR /home/container COPY --from=builder /home/container/target/API.jar . # We're running in production -ENV APP_ENV "production" +ENV APP_ENV="production" # Run the jar file CMD java -jar API.jar -Djava.awt.headless=true \ No newline at end of file diff --git a/src/main/java/cc/pulseapp/api/PulseAPI.java b/src/main/java/cc/pulseapp/api/PulseAPI.java index a0babf4..341a2b0 100644 --- a/src/main/java/cc/pulseapp/api/PulseAPI.java +++ b/src/main/java/cc/pulseapp/api/PulseAPI.java @@ -36,6 +36,11 @@ public class PulseAPI { SpringApplication.run(PulseAPI.class, args); // Start the app } + /** + * Configures CORS for the API. + * + * @return the WebMvc config + */ @Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurer() { @@ -43,11 +48,7 @@ public class PulseAPI { public void addCorsMappings(@NonNull CorsRegistry registry) { // Allow all origins to access the API registry.addMapping("/**") - .allowedOrigins("*") // Allow all origins - .allowedMethods("*") // Allow all methods - .allowedHeaders("*"); // Allow all headers -// registry.addMapping("/*") -// .allowedOrigins("http://localhost:9000"); + .allowedOrigins("*"); // Allow all origins } }; }