Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class App {
- public static void main(String[] args) throws Exception {
- RatpackServer.start(s -> s
- .serverConfig( configBuilder -> configBuilder
- .findBaseDir()
- .props("db.properties")
- .require("/database", Settings.class)
- )
- .registry(Guice.registry( bindings -> bindings
- .module(HikariModule.class, hm -> {
- hm.setDataSourceClassName("org.postgresql.ds.PGSimpleDataSource");
- hm.addDataSourceProperty("url", "jdbc:postgresql://localhost:5433/ratpack");
- hm.setUsername("postgres");
- hm.setPassword("postgres");
- }).bind(DatabaseInit.class)
- ))
- .handlers( chain -> chain
- ...
- )
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement