As you can see the image below, My HTML index page is at static folder. How can I point localhost to static/index.html
Tried on my own on basic hello world.
static class MyHandler implements HttpHandler {
public void
handle(HttpExchange t) throws IOException {
String response = "Hello world";
t.sendResponseHeaders(200, response.length());
OutputStream os = t.getResponseBody();
os.write(response.getBytes()); os.close();
}
}
I need to know how I can point the default localhost:8080 to my pre-built existing static/index.html page?