import ratpack.exec.Blocking;
import ratpack.hikari.HikariModule;
import ratpack.server.BaseDir;
import ratpack.server.RatpackServer;
import ratpack.groovy.template.TextTemplateModule;
import ratpack.guice.Guice;

import static ratpack.groovy.Groovy.groovyTemplate;

import java.util.*;
import java.sql.*;

import javax.sql.DataSource;

public class Main {
  public static void main(String... args) throws Exception {
    RatpackServer.start(s -> s
        .serverConfig(c -> c
          .baseDir(BaseDir.find())
          .env())

        .registry(Guice.registry(b -> {
          if (System.getenv("JDBC_DATABASE_URL") != null) {
            b.module(HikariModule.class, conf -> {
              conf.addDataSourceProperty("URL", System.getenv("JDBC_DATABASE_URL"));
              conf.setDataSourceClassName("org.postgresql.ds.PGSimpleDataSource");
            });
          }
          b.module(TextTemplateModule.class, conf -> conf.setStaticallyCompile(true));
        }))

        .handlers(chain -> chain
            .get(ctx -> ctx.render(groovyTemplate("index.html")))

            .get("hello", ctx -> {
              ctx.render("Hello!");
            })

            .get("db", ctx -> {
              boolean local = !"heroku-16".equals(System.getenv("STACK"));

              Blocking.get(() -> {
                try (Connection connection = ctx.get(DataSource.class).getConnection()) {
                  Statement stmt = connection.createStatement();
                  stmt.executeUpdate("CREATE TABLE IF NOT EXISTS ticks (tick timestamp)");
                  stmt.executeUpdate("INSERT INTO ticks VALUES (now())");
                  return stmt.executeQuery("SELECT tick FROM ticks");
                }
              }).onError(throwable -> {
                Map<String, Object> attributes = new HashMap<>();
                attributes.put("message", "There was an error: " + throwable);
                ctx.render(groovyTemplate(attributes, "error.html"));
              }).then(rs -> {
                ArrayList<String> output = new ArrayList<>();
                while (rs.next()) {
                  output.add("Read from DB: " + rs.getTimestamp("tick"));
                }

                Map<String, Object> attributes = new HashMap<>();
                attributes.put("results", output);
                ctx.render(groovyTemplate(attributes, "db.html"));
              });
            })

            .files(f -> f.dir("public"))
        )
    );
  }
}
@@ -1195,84 +1195,8 @@
 %3E %7B%0A
-              boolean local = !%22heroku-16%22.equals(System.getenv(%22STACK%22));%0A%0A
     

Remove unused variable