First question: is there maven already available for this library? Mostly to ease upgrades in the future.
Second question: what strategy would you recommend for adding https on the communication channel?
Thanks.
Maven integration is not there yet. Gradle makes it easy to generate a POM, but I have honestly never published anything to central, and I don't even know what is necessary for that. I have added this to my to-do list.
HTTPS is something I won't have to deal with myself, because I'll be running it in a context (Cloud Run on Google Cloud Platform) with external HTTPS termination. If you have any chance to do the same, I'd highly recommend it, because you can use standardized solutions. Other than that, the current version runs on embedded Jetty, but is actually just a servlet code-wise, so any servlet container would do. Again, this is not possible out-of-the-box (unless you don't mind cloning grumpyrest and modifying the code), but likely will be in the future. Once you can use a standard servlet container, such as Tomcat, you can just follow the normal how-tos on how to add HTTPS.
You instantiate a RestApi object and then . . . . magic?
public static class MyServlet extends RestServlet {
public MyServlet() {
super(buildApi());
}
private static RestApi buildApi() {
RestApi api = new RestApi();
...
return api;
}
}
It's a bit annoying right now, but that's because the servlet is supposed to be constructed by the servlet container using a no-arg constructor. I hope I can improve this in the future.