This is your code.
Read it: it’s exactly what’s going to happen.
No mysticism.
What’s going on?
pledge(2) makes sure
you’re only doing what you want to do: work with existing descriptors.
The rest is just HTTP.
Don’t want to work with HTTP?
Use kcgi(3) or equivalent.
httpd.conf(5)
is so… simple.
Server tells us the name.
Listen tells us to listen.
Location tells us a location.
Where we have FastCGI.
Relative to the root.
Don’t like FastCGI?
Neither do we.
But we’re not using it for this example: in the next snippet,
we’ll use slowcgi(8) to
invoke our CGI.
So relax.