package tech.greenfield.vertx.irked.server;

import io.vertx.core.AbstractVerticle;
import io.vertx.core.Future;
import io.vertx.core.http.HttpServer;
import io.vertx.core.http.HttpServerOptions;
import tech.greenfield.vertx.irked.Controller;
import tech.greenfield.vertx.irked.Irked;

public class Server extends AbstractVerticle {

	private Controller test;
	private HttpServer server;

	public Server(Controller testController) {
		test = testController;
	}

	@Override
	public void start(Future<Void> startFuture) throws Exception {
		Future<HttpServer> async = Future.future();
		(server = vertx.createHttpServer(new HttpServerOptions())).requestHandler(
				Irked.router(vertx).configure(test).configReport()::accept)
				.listen(config().getInteger("port"), async);
		async.map((Void) null).setHandler(startFuture);
	}

	@Override
	public void stop(Future<Void> stopFuture) throws Exception {
		server.close(stopFuture);
	}
	
}

@@ -380,16 +380,95 @@
  server;
+%0A%09private static HttpServerOptions httpServerOptions = new HttpServerOptions();
 %0A%0A%09publi
@@ -690,20 +690,19 @@
 pServer(
-new 
+get
 HttpServ
@@ -844,16 +844,16 @@
 async);%0A
-
 %09%09async.
@@ -894,24 +894,114 @@
 uture);%0A%09%7D%0A%0A
+%09public static HttpServerOptions getHttpServerOptions() %7B%0A%09%09return httpServerOptions;%0A%09%7D%0A%0A
 %09@Override%0A%09

add easy support for updating built-in verticle's http server options