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 } }; }