Advertisement
Guest User

Untitled

a guest
Sep 4th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. public class App {
  2.  
  3. public static void main(String[] args) throws Exception {
  4. RatpackServer.start(s -> s
  5. .serverConfig( configBuilder -> configBuilder
  6. .findBaseDir()
  7. .props("db.properties")
  8. .require("/database", Settings.class)
  9. )
  10. .registry(Guice.registry( bindings -> bindings
  11. .module(HikariModule.class, hm -> {
  12. hm.setDataSourceClassName("org.postgresql.ds.PGSimpleDataSource");
  13. hm.addDataSourceProperty("url", "jdbc:postgresql://localhost:5433/ratpack");
  14. hm.setUsername("postgres");
  15. hm.setPassword("postgres");
  16. }).bind(DatabaseInit.class)
  17. ))
  18. .handlers( chain -> chain
  19. ...
  20. )
  21. );
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement