package is.ru.sparkit;

import spark.*;
import static spark.Spark.*;
import spark.servlet.SparkApplication;

public class ChuckWeb implements SparkApplication {
    public static void main(String[] args){
        SparkApplication chuckweb = new ChuckWeb();
        chuckweb.init(); 
    }

    public void init(){
        final ChuckJoke chuckjoke = new ChuckJoke();
        
        get(new Route("/"){
            @Override
            public Object handle(Request request, Response response){
                return chuckjoke.getRandom();
            }
        });
    }
}

@@ -560,16 +560,262 @@
      %7D);
+%0A%0A        get(new Route(%22/id/:param%22)%7B%0A            @Override%0A            public Object handle(Request request, Response response)%7B%0A                return chuckjoke.getSpecific(Integer.parseInt(request.params(%22:param%22)));%0A            %7D%0A        %7D);
 %0A    %7D%0A%7D

Allow fetching jokes by id in Web