Skip to content

Instantly share code, notes, and snippets.

@lucaspolo
Created May 12, 2014 17:46
Show Gist options
  • Save lucaspolo/af6fceecf59e0b70ca66 to your computer and use it in GitHub Desktop.
Save lucaspolo/af6fceecf59e0b70ca66 to your computer and use it in GitHub Desktop.
package br.com.alura.loja;
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 Servidor {
public static void main(String[] args) throws IOException {
URI uri = URI.create("http://localhost:8080");
ResourceConfig config = new ResourceConfig().packages("br.com.alura.loja");
HttpServer server = GrizzlyHttpServerFactory.createHttpServer(uri, config);
System.out.println("Servidor rodando");
System.in.read();
server.stop();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment