}
private Inflector<ContainerRequestContext, Response> setupHandler() {
return new Inflector<ContainerRequestContext, Response>() {
public Response apply(ContainerRequestContext ctx) {
App app = new App(Config.APP_NAME_NS); // the root app name
if (app.exists()) {
return RestUtils.getStatusResponse(Response.Status.OK, "All set!");
} else {
app.setName(Config.APP_NAME);
app.create();
Map<String, String> creds = app.getCredentials();
creds.put("info", "Save the secret key! It is showed only once!");
return Response.ok(creds).build();
}
}
};