#!/bin/sh
source ./martin.sh
get "/" root; proc root {
header "Content-Type" "text/html; charset=utf-8"
cat << """
hello world from $PATH_INFO
hello world from $PATH_INFO
processes
redirect
"""
}
get "/ps" ps_handler; proc ps_handler {
header "Content-Type" "text/plain"
ps
}
get "/DeanMartin.jpg" dean_handler; proc dean_handler {
header "Content-Type" "image/jpeg"
cat "DeanMartin.jpg"
}
get "/redirect" redirect_handler; proc redirect_handler {
status 302
header "Location" "http://jackjs.org/"
}
martin $PORT