package twopm.tech.bench.jaxrs;

import com.sun.net.httpserver.HttpServer;
import java.io.IOException;
import java.net.URI;
import org.glassfish.jersey.jdkhttp.JdkHttpServerFactory;
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, InterruptedException {
		final ResourceConfig rc = new ResourceConfig().packages("twopm.tech.bench.jaxrs");
		final HttpServer server = JdkHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);
		Runtime.getRuntime().addShutdownHook(new Thread(() -> {
			server.stop(0);
		}));
	}
}
