|Did you know ...||Search Documentation:|
The SWI-Prolog HTTP server doesn't not server static files by default.
You explicitly have to add a handler telling it to do so. The
declarations below tell the server to serve files from the current
/ on the server.
:- use_module(library(http/http_server)). :- use_module(library(http/http_files)). :- http_handler(root(.), http_reply_from_files('.', ), [prefix]).
Now, start the server and visit http://localhost:8080/.
?- http_server([port(localhost:8080)]). % Started server at http://localhost:8080/ true.
localhost:only binds the loopback network, avoiding to expose your website to the outside world.