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

  1. #!/usr/bin/env lua
  2. local fcgi = require"fcgi"
  3. apps = {
  4. yqtemplate = require"yqtemplate"
  5. }
  6. while fcgi.accept() do
  7. app = fcgi.getenv("DOCUMENT_URI"):sub(6)
  8. appfn = apps[app]
  9. if appfn then
  10. appfn.run(fcgi)
  11. else
  12. fcgi.print"Content-Type: text/plain; charset=utf-8\r\n\r\n"
  13. fcgi.print("No such application application: `" .. app .. "'\n")
  14. fcgi.print("Available applications:\n")
  15. for n, x in pairs(apps) do
  16. fcgi.print(" - " .. n .. ": " .. x.desc .. "\n")
  17. end
  18. end
  19. end