I'm building a simple spark application with netbeans Maven. The issue is when I try to access my spark link, I have to put localhost instead of my public IP address. How could I put my public IP address instead of local host or local IP address?
My code is simple, copied from the spark framework website.
public class Main {
public static void main(String[] args) {
get("/hello/:name", new Route() {
public Object handle(Request req, Response res) throws Exception {
return "Hello sari i'm here"+ req.params(":name");
}
});
}
}