Skip to content

Instantly share code, notes, and snippets.

@scobal
Created July 31, 2014 10:18
Show Gist options
  • Select an option

  • Save scobal/ab8de8abc75bdfbe9082 to your computer and use it in GitHub Desktop.

Select an option

Save scobal/ab8de8abc75bdfbe9082 to your computer and use it in GitHub Desktop.
public class KriegerHttpServer {
public static final String BASE_URI = "http://localhost:8080/krieger-web/";
private static HttpServer SERVER;
public static synchronized void stopServer() {
SERVER.stop();
SERVER = null;
}
public static synchronized void startServer() throws IOException {
if (SERVER == null) {
SERVER = GrizzlyServerFactory.createHttpServer(URI.create(BASE_URI)));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment