use of com.eden.orchid.server.api.OrchidResponse in project Orchid by JavaEden.
the class AdminController method renderList.
@Get(path = "/lists/:name")
public OrchidResponse renderList(OrchidRequest request, String name) {
Clog.v("calling /admin/lists/:name");
OrchidResource resource = resources.getResourceEntry("templates/server/admin/lists/" + name + ".twig");
if (resource != null) {
JSONObject data = new JSONObject();
data.put("httpServerPort", server.get().getHttpServerPort());
data.put("websocketPort", server.get().getWebsocketPort());
data.put(name, getList(name));
return new OrchidResponse(context.getTheme().compile(resource.getReference().getExtension(), resource.getContent(), data));
}
return new OrchidResponse("List not found");
}
use of com.eden.orchid.server.api.OrchidResponse in project Orchid by JavaEden.
the class AdminController method doNothing.
@Get(path = "/")
public OrchidResponse doNothing(OrchidRequest request) {
Clog.v("calling /admin");
OrchidResource resource = resources.getResourceEntry("templates/server/admin/admin.twig");
String content = "";
if (resource != null) {
JSONObject data = new JSONObject();
data.put("httpServerPort", server.get().getHttpServerPort());
data.put("websocketPort", server.get().getWebsocketPort());
content = context.getTheme().compile(resource.getReference().getExtension(), resource.getContent(), data);
}
return new OrchidResponse(content);
}
use of com.eden.orchid.server.api.OrchidResponse in project Orchid by JavaEden.
the class ApiController method doNothing.
@Get(path = "/")
public OrchidResponse doNothing(OrchidRequest request) {
Clog.v("calling /api");
JSONObject object = new JSONObject();
object.put("message", "Successful API hit");
return new OrchidResponse(object);
}
Aggregations