Main.java 732 B

123456789101112131415161718192021222324252627
  1. package io.senslog.app;
  2. import io.senslog.database.DBConfig;
  3. import io.senslog.database.DBRepositoryPool;
  4. public class Main {
  5. public static void main(String[] args) throws Exception {
  6. Parameters params = null;
  7. try {
  8. params = Parameters.parse(args);
  9. } catch (RuntimeException e) {
  10. System.err.println(e.getMessage());
  11. System.exit(1);
  12. }
  13. DBConfig dbConfig = new DBConfig(
  14. "jdbc:postgresql://localhost:5432/senslog1",
  15. "postgres", "root", 6
  16. );
  17. DBRepositoryPool.create(dbConfig);
  18. new JettyServer()
  19. .start(params.getPort(), params.getPathPrefix());
  20. }
  21. }