package twopm.tech.bench.jaxrs;

import java.io.IOException;
import java.net.URI;
import org.glassfish.grizzly.http.server.HttpServer;
import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
import org.glassfish.jersey.server.ResourceConfig;

public class Bench {

	public static final String BASE_URI = "http://0.0.0.0:8080/";

	public static void main(String[] args) throws IOException {
		final ResourceConfig rc = new ResourceConfig().packages("twopm.tech.bench.jaxrs");
		final HttpServer server = GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);
		Runtime.getRuntime().addShutdownHook(new Thread(() -> {
			server.shutdownNow();
		}));
		server.start();
	}

}
