Last active
May 11, 2016 13:01
-
-
Save leonmaia/1d5be26d0d62f68d2a8553ddf296d648 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public class HttpServer { | |
static InetSocketAddress addr = new InetSocketAddress(InetAddress.getLoopbackAddress(), 8888); | |
public static void main(String[] args) throws Exception { | |
Service<Request, Response> service = router(); | |
ListeningServer server = Http.server().serve(addr, service); | |
Await.ready(server); | |
} | |
private static HttpMuxer router() { | |
return new HttpMuxer() | |
.withHandler("/cat", Handlers.echoHandler()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment