After fiddling around for a couple of minutes I found the correct incantation to get cgi scripts to work with Windows Apache. It uses the traditional Unix hash-bang line. Here we have a nice little hello world cgi:
#!mzscheme -mqf (define *query-string* (getenv "QUERY_STRING")) (define (header type) (string-append "Content-type: " type "; charset=iso-8859-1~n~n")) (printf (header "text/html")) (printf "Hello World~n") (when *query-string* (printf "[~a]~n" *query-string*)) (exit)
But why bother with CGI when there are all these wonderful frameworks around? Isn’t that old-school? Well, I’ve been inspired by something in Seaside. I’m not thinking of porting the whole framework, no way. If I wanted to, then why not just use Seaside? No, I want to try something much smaller.
Advertisements
I agree, why bother when there are theese wonderful frameworks around
[…] Here is a post on using mzscheme for CGI. […]