newLips http server, access from within newLisp
newLips http server, access from within newLisp
Are there any plans to offer an api to access the development server, with an api from newLisp instead of the command line? I'm looking at creating a few small packaged servers that I would like to have configured and executed from newLips. Having some soft of API for the built in HTTP processor would be nice. Has anyone done this before?
Re: newLips http server, access from within newLisp
you can start one or more new instances from a newLISP script:
the index.html is in the /Users/lutz/test/ working directory. Instead of port 12345 choose 80 for the HTTP default port, but you would need administrator permissions for ports < 1024 on Unix like platforms.
PS: see also the map-reduce example for net-eval servers instead of http servers:
http://www.newlisp.org/syntax.cgi?code/mapreduce.txt
Code: Select all
newLISP v.10.6.2 64-bit on OSX IPv4/6 UTF-8 libffi, options: newlisp -h
> (process "/usr/bin/newlisp -http -d12345 -w/Users/lutz/test/")
9965
> (get-url "http://localhost:12345")
"<html>\n<head>\n<title>Index</title>\n<h1>Hello World</h1>\n</body>\n</html>\n"
>
PS: see also the map-reduce example for net-eval servers instead of http servers:
http://www.newlisp.org/syntax.cgi?code/mapreduce.txt
Re: newLips http server, access from within newLisp
Thanks Lutz. I was asking because I was hoping I could source link -x into a simple single executable .
Re: newLips http server, access from within newLisp
I think I misunderstood in how net-eval can be used, as in the map reduce examples. It's not what I had in mind, but I think I get can what I wanted using this.