Created
August 18, 2020 22:18
-
-
Save kaiser185/302a6156ea1fbf19fe3711e8a56fb505 to your computer and use it in GitHub Desktop.
Vanilla SWI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:- use_module(library(http/thread_httpd)). | |
:- use_module(library(http/http_dispatch)). | |
:- http_handler(root(sam), say_hi, []). % (1) | |
server(Port) :- % (2) | |
http_server(http_dispatch, [port(Port)]). | |
say_hi(_Request) :- % (3) | |
format('Content-type: text/plain~n~n'), | |
format('Hello World!~n'). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment