Created
September 13, 2019 14:12
-
-
Save doorbash/3245a2e635f72cd68454dead18846860 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
import io.undertow.Undertow; | |
import io.undertow.server.HttpHandler; | |
import io.undertow.server.HttpServerExchange; | |
public class HelloWorldServer { | |
public static void main(final String[] args) { | |
Undertow server = Undertow.builder() | |
.addHttpListener(8081, "localhost") | |
.setHandler(new HttpHandler() { | |
@Override | |
public void handleRequest(final HttpServerExchange exchange) throws Exception { | |
exchange.getResponseSender().send("Hello World!"); | |
} | |
}).build(); | |
server.start(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment