package ru.kirillius.pf.sdn;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;

@SpringBootApplication
public class PfSdnApplication {
    private final static String DATABASE_FILE = "pfsdn";

    public static void main(String[] args) {

        /*
        ENV:
        SERVER_PORT=8080
        APP_DATA=/var/lib/pfsdn

        ARGS:
        -Dserver.port=8080
        -app.data=/var/lib/pfsdn
         */

        //System.setProperty("server.port", String.valueOf(configData.port()));
        //System.setProperty("jwt.secret", configData.jwtSecret());
        var appData = System.getProperty("app.data", ".");
        System.setProperty("app.datasource.url", "jdbc:h2:file:" + appData + "/" + DATABASE_FILE);

        new SpringApplicationBuilder(PfSdnApplication.class).run(args);
    }


}
