:- use_module(library(http/thread_httpd)).
:- use_module(library(http/http_dispatch)).
:- initialization(server(7007), main).
:- http_handler(/, say_hi, []).

server(Port) :-
    writef("Starting Server at %d", [Port]),
    http_server(http_dispatch, [port(Port)]),
    thread_get_message(_).

say_hi(_Request) :-
    format('Content-type: text/plain~n~n'),
    format('Hello World!~n').
