Closed 7c6f434c closed 10 years ago
Yes, this can be done by invoking plackup -s CGI nix-serve.psgi
. Example:
$ REQUEST_METHOD=GET SCRIPT_NAME=nix-serve SERVER_NAME=foo SERVER_PORT=12345 REQUEST_URI=/nix-cache-info PATH_INFO=/nix-cache-info plackup -s CGI ./nix-serve.psgi 2> /dev/null
Status: 200 OK
Content-Type: text/plain
StoreDir: /nix/store
WantMassQuery: 1
Priority: 30
Can this be run as CGI? Would a very dumb CGI wrapper that launches the server at a random port unless it is already running get accepted? I have Apache anyway, and I want a drop-and-forget CGI, or a NixOS service…