mirror of
https://github.com/jlengrand/cellar.git
synced 2026-03-10 08:01:19 +00:00
Adds local config file
This commit is contained in:
@@ -1,15 +1,27 @@
|
||||
package nl.lengrand.cellar;
|
||||
|
||||
import io.helidon.config.Config;
|
||||
import io.helidon.microprofile.server.Server;
|
||||
|
||||
import java.io.IOException;
|
||||
import static io.helidon.config.ConfigSources.classpath;
|
||||
import static io.helidon.config.ConfigSources.file;
|
||||
|
||||
public class Main {
|
||||
|
||||
private Main() {
|
||||
private Main() {}
|
||||
|
||||
public static void main(final String[] args){
|
||||
Server.builder()
|
||||
.config(buildConfig())
|
||||
.build().start();
|
||||
}
|
||||
|
||||
public static void main(final String[] args) throws IOException {
|
||||
Server.create().start();
|
||||
private static Config buildConfig() {
|
||||
return Config.builder()
|
||||
.disableEnvironmentVariablesSource()
|
||||
.sources(
|
||||
file("cellar-config.properties").optional(),
|
||||
classpath("META-INF/microprofile-config.properties"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user