Hi Gregor,
For similar purpose I start a server with something like:
Code: Select all
newlisp.exe -c -d 4780 -w ..\MyProjects\ToWeb
(on Windows OS)
In ..\MyProjects\ToWeb I've put index.cgi which might look like (minimalistic):
Code: Select all
#!/usr/bin/newlisp
(print "Content-type: text/html\r\n\r\n")
(module "cgi.lsp")
(define (my-hubert) (println "<h3>Hello World!</h3>"))
(apply (read-expr (CGI:params 0 0)))
(exit)
Then I open in a browser
http://localhost:4780/?my-hubert
:) Not the absolute elegance, but it works...
PS notes:
- I don't remember why I left -c parameter when starting the server. May be it's not important and -http will be fine too
- The first line of index.cgi is important for Linux. I use the same code on both Windows and Linux machines at home.
- In index.cgi you can use (load "path-to-some-newlisp-file") to load more functions and/or data, of course.
- I'm using this for a very simplistic implementation of Wiki combined with Markdown-like coding ... it's great fun to see it working with so small code :)
Good Luck and please, share how Your experiments go.
PPS. I'm sorry, I didn't pay enough attention to httpd-conf.lsp. It's obvious, that the command-event function could transform a nicer "outside" url like
http://localhost:4780/my-hubert to the "inner" for my approach url, i.e.
http://localhost:4780/?my-hubert