public static void main(String[] args) {

        // port(5678); <- Uncomment this if you want spark to listen on a
        // port different than 4567.

        secure(
                SparkTestUtil.getKeyStoreLocation(),
                SparkTestUtil.getKeystorePassword(), null, null);

        get("/hello", (request, response) -> "Hello Secure World!");

        post("/hello", (request, response) -> "Hello Secure World: " + request.body());

        get("/private", (request, response) -> {
            response.status(401);
            return "Go Away!!!";
        });

        get("/users/:name", (request, response) -> "Selected user: " + request.params(":name"));

        get("/news/:section", (request, response) -> {
            response.type("text/xml");
            return "<?xml version=\"1.0\" encoding=\"UTF-8\"?><news>"
                    + request.params("section") + "</news>";
        });

        get("/protected", (request, response) -> {
            halt(403, "I don't think so!!!");
            return null;
        });

        get("/redirect", (request, response) -> {
            response.redirect("/news/world");
            return null;
        });

        get("/", (request, response) -> "root");
    }
A simple example just showing some basic functionality.

@author Peter Nicholls, based on (practically identical to in fact)
        {@link spark.examples.simple.SimpleExample} by Per Wendel
src/test/java/spark/examples/simple/SimpleSecureExample.java