You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
549 B

#!/usr/bin/env lua
local fcgi = require"fcgi"
apps = {
yqtemplate = require"yqtemplate"
}
while fcgi.accept() do
app = fcgi.getenv("DOCUMENT_URI"):sub(6)
appfn = apps[app]
if appfn then
appfn.run(fcgi)
else
fcgi.print"Content-Type: text/plain; charset=utf-8\r\n\r\n"
fcgi.print("No such application application: `" .. app .. "'\n")
fcgi.print("Available applications:\n")
for n, x in pairs(apps) do
fcgi.print(" - " .. n .. ": " .. x.desc .. "\n")
end
end
end