Skip to content

Instantly share code, notes, and snippets.

@doorbash
Created September 13, 2019 14:12
Show Gist options
  • Save doorbash/3245a2e635f72cd68454dead18846860 to your computer and use it in GitHub Desktop.
Save doorbash/3245a2e635f72cd68454dead18846860 to your computer and use it in GitHub Desktop.
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