setup dotenv for spring
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
package fr.tetelie.crawler;
|
package fr.tetelie.crawler;
|
||||||
|
|
||||||
|
import io.github.cdimascio.dotenv.Dotenv;
|
||||||
import org.jsoup.Jsoup;
|
import org.jsoup.Jsoup;
|
||||||
import org.jsoup.nodes.Document;
|
import org.jsoup.nodes.Document;
|
||||||
import org.jsoup.nodes.Element;
|
import org.jsoup.nodes.Element;
|
||||||
@ -24,6 +25,9 @@ public class Crawler {
|
|||||||
// Si pas de connexion à la base de donnée on s'arrête ici
|
// Si pas de connexion à la base de donnée on s'arrête ici
|
||||||
if(!isConnected){return;};
|
if(!isConnected){return;};
|
||||||
|
|
||||||
|
|
||||||
|
Dotenv dotenv = Dotenv.configure().ignoreIfMissing().load();
|
||||||
|
dotenv.entries().forEach(entry -> System.setProperty(entry.getKey(), entry.getValue()));
|
||||||
SpringApplication.run(Crawler.class, args);
|
SpringApplication.run(Crawler.class, args);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user