yes?
All checks were successful
Deploy API / deploy (ubuntu-latest, 2.44.0) (push) Successful in 59s
All checks were successful
Deploy API / deploy (ubuntu-latest, 2.44.0) (push) Successful in 59s
This commit is contained in:
parent
f35316472c
commit
b6e97d47a2
@ -20,7 +20,7 @@ WORKDIR /home/container
|
|||||||
COPY --from=builder /home/container/target/API.jar .
|
COPY --from=builder /home/container/target/API.jar .
|
||||||
|
|
||||||
# We're running in production
|
# We're running in production
|
||||||
ENV APP_ENV "production"
|
ENV APP_ENV="production"
|
||||||
|
|
||||||
# Run the jar file
|
# Run the jar file
|
||||||
CMD java -jar API.jar -Djava.awt.headless=true
|
CMD java -jar API.jar -Djava.awt.headless=true
|
@ -36,6 +36,11 @@ public class PulseAPI {
|
|||||||
SpringApplication.run(PulseAPI.class, args); // Start the app
|
SpringApplication.run(PulseAPI.class, args); // Start the app
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configures CORS for the API.
|
||||||
|
*
|
||||||
|
* @return the WebMvc config
|
||||||
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public WebMvcConfigurer corsConfigurer() {
|
public WebMvcConfigurer corsConfigurer() {
|
||||||
return new WebMvcConfigurer() {
|
return new WebMvcConfigurer() {
|
||||||
@ -43,11 +48,7 @@ public class PulseAPI {
|
|||||||
public void addCorsMappings(@NonNull CorsRegistry registry) {
|
public void addCorsMappings(@NonNull CorsRegistry registry) {
|
||||||
// Allow all origins to access the API
|
// Allow all origins to access the API
|
||||||
registry.addMapping("/**")
|
registry.addMapping("/**")
|
||||||
.allowedOrigins("*") // Allow all origins
|
.allowedOrigins("*"); // Allow all origins
|
||||||
.allowedMethods("*") // Allow all methods
|
|
||||||
.allowedHeaders("*"); // Allow all headers
|
|
||||||
// registry.addMapping("/*")
|
|
||||||
// .allowedOrigins("http://localhost:9000");
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user