public static void main(String[] args) throws UnknownHostException {
        MongoClient client = new MongoClient(new ServerAddress("localhost", 27017));
        final DB db = client.getDB("course");

        Spark.get(new Route("/") {
            @Override
            public Object handle(Request request, Response response) {
                DBCollection users = db.getCollection("user");
                DBObject user = users.findOne();
                StringWriter writer = new StringWriter();
                Configuration configuration = new Configuration();
                configuration.setClassForTemplateLoading(HelloWorldMongoDBSparkFreemarkerStyle.class, "/");

                try {
                    Template template = configuration.getTemplate("hello.ftl");
                    template.process(user, writer);
                } catch (Exception e) {
                    halt(100);
                    e.printStackTrace();
                }

                return writer;
            }
        });
    }