Skip to content

Instantly share code, notes, and snippets.

@jklingsporn
Created January 4, 2016 18:34
Show Gist options
  • Save jklingsporn/4966ad9c6194cfab65b0 to your computer and use it in GitHub Desktop.
Save jklingsporn/4966ad9c6194cfab65b0 to your computer and use it in GitHub Desktop.
@Override
public void start() throws Exception {
super.start();
router.route("/resources/*").handler(StaticHandler.create("webroot/resources"));
router.route().handler(FaviconHandler.create("webroot/favicon.ico"));
PebbleTemplateEngine templateEngine = new PebbleTemplateEngine();
TemplateHandler templateHandler = TemplateHandler.create(templateEngine, "webroot/templates","text/html");
router.route("/templates/*").handler(templateHandler);
router.route().handler(h->h.reroute("/templates/chat_client.html"));
vertx.createHttpServer().requestHandler(router::accept).listen(8080);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment