declare TCP 8000
declare TLS 8001
# We will use ports 8000 and 8001 with TCP and TLS respectively

key domain.key 8001
cert domain.crt 8001
# Port 8001 can have TLS, but it's self signed and very bad.

timeout 20000 8000
timeout 20000 8001
# Set these values for the ports

set port 8000
# The following pages will respond to port 8000

define library ./library.so
# Library calls should use ./library.so

set host localhost:8000
# The following pages will respond to the host localhost:8000
set type text/html
# The following pages are html
read / site/index.html
# The path / should be read from site/index.html
read /hello site/hello.html
# The path /hello should be read from site/hello.html

throw /blog/forbidden 403
# The path /blog/forbidden should throw error code 403
read /blog/.* site/blog/
# /blog/2021-1-25.html turns into site/blog//blog/2021-1-25.html

set type text/text
linked /library
set type text/html
# The path /library should be dynamically loaded from the library (library.so)

set host .*
# The following pages will respond to the host .* (any host)

read / site/easteregg.html
# The path / should be read from site/easteregg.html
set type image/png
read /egg.png site/egg.png
set type text/html
# The path /egg.png should be read from site/egg.png
read /alldomains site/alldomains.html
# The path /alldomains should be read from /site/alldomains.html

set port 8001
# The following pages will respond to port 8001

read / site/8001.html
# The path / should be read from site/8001.html

set port 8000,8001

read /shared site/shared.html
