From 0b3569e133bfcfd9b0012c5d33830264e3c939c7 Mon Sep 17 00:00:00 2001 From: Firestone82 Date: Sun, 28 Jan 2024 21:36:48 +0100 Subject: [PATCH] Fixes Took 9 minutes --- .../api/TtsApiApplication.java | 32 +++++++++---------- src/main/resources/application.properties | 1 + 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/main/java/cz/trailsthroughshadows/api/TtsApiApplication.java b/src/main/java/cz/trailsthroughshadows/api/TtsApiApplication.java index b70542b..65adb2a 100644 --- a/src/main/java/cz/trailsthroughshadows/api/TtsApiApplication.java +++ b/src/main/java/cz/trailsthroughshadows/api/TtsApiApplication.java @@ -19,22 +19,22 @@ public static void main(String[] args) { // ObjectMapper mapper = new ObjectMapper(); // mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); - //.env file load -// Dotenv dotenv = Dotenv.configure().directory(".config").load(); -// -// Map env = new HashMap<>(); -// env.put("spring.datasource.url", dotenv.get("DB_HOST") + ":" + dotenv.get("DB_PORT") + "/" + dotenv.get("DB")); -// env.put("spring.datasource.driver-class-name", dotenv.get("DB_DRIVER")); -// env.put("spring.datasource.username", dotenv.get("DB_USER")); -// env.put("spring.datasource.password", dotenv.get("DB_PASSWORD")); -// //jdbc:mariadb://49.13.93.112:3306/tts_api -// -// SpringApplication app = new SpringApplication(TtsApiApplication.class); -// app.setDefaultProperties(env); -// app.run(args); -// log.debug("Running with login: " + dotenv.get("DB_USER") + " -> " + dotenv.get("DB_PASSWORD")); - - SpringApplication.run(TtsApiApplication.class, args); +// .env file load + Dotenv dotenv = Dotenv.configure().directory(".config").load(); + + Map env = new HashMap<>(); + env.put("spring.datasource.url", dotenv.get("DB_HOST") + ":" + dotenv.get("DB_PORT") + "/" + dotenv.get("DB")); + env.put("spring.datasource.driver-class-name", dotenv.get("DB_DRIVER")); + env.put("spring.datasource.username", dotenv.get("DB_USER")); + env.put("spring.datasource.password", dotenv.get("DB_PASSWORD")); + //jdbc:mariadb://49.13.93.112:3306/tts_api + + SpringApplication app = new SpringApplication(TtsApiApplication.class); + app.setDefaultProperties(env); + app.run(args); + log.debug("Running with login: " + dotenv.get("DB_USER") + " -> " + dotenv.get("DB_PASSWORD")); + +// SpringApplication.run(TtsApiApplication.class, args); log.info("Docs running on http://localhost:8080/swagger-ui/index.html"); log.info("API running on http://localhost:8080/"); } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index b916747..d94ac70 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -14,6 +14,7 @@ spring.jpa.show-sql=true springdoc.api-docs.path=/api-docs springdoc.swagger-ui.path=/swagger-ui-custom.html springdoc.swagger-ui.tagsSorter=alpha +server.forward-headers-strategy=framework # Logging logging.level.root=INFO