Created
May 12, 2014 17:46
-
-
Save lucaspolo/af6fceecf59e0b70ca66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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