简体   繁体   中英

Run prolog and look at the result in browser

I want to run a file prolog test.pl and look at the result in browser and I added three lines in file prolog. But it doesn't work. Can you guys tell me why? all

enter image description here

You have to define a http_handler to tell prolog which predicate it should run when it receives a request.

% tells prolog to call process_request
:- http_handler(root(.), process_request, []).

process_request(_Request) :-
    % your code here
    .

A simple "Hello World" example example can be found here ; look here for a more detailed tutorial.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM