I created the Pengine object, and it sends a request to /pengine/create in the json format.
var pengine = new Pengine({});
This is my http handler. I use library(http/json_convert) to convert the request, but I am getting only 2 params in the term json([src_text=,format=json]). When I just print the JSON term through json_reply I see the pengine property (see the picture below)
I don’t really get the question. Why define a pengines create handler? That is part of library(pengines). The question may also be about json_to_prolog/2.
json_to_prolog/2 should typically be considered old school. These days use http_read_json_dict/2 and use the dict. The conversion was intended to convert e.g. {type: point, x:10, y:30} into point(x,y). That may still have some value in some scenarios. Possibly dicts_to_compounds/4 is more useful and easier to understand.
I miss the overall picture. The HTTP binding for creating pengines is in library(pengines). All you need to do is create an HTTP server and load library(pengines) to have a working pengines server. The minimum is this
:- use_module(library(http/http_server)).
:- use_module(library(pengines)).
server :-
http_server([port(8080)]).