#!/usr/bin/env lua local fcgi = require"fcgi" local yqtemplate = require"yqtemplate" while fcgi.accept() do app = fcgi.getenv("DOCUMENT_URI"):sub(6) if app = "yqtemplate" then yqtemplate(fcgi) else fcgi.print"Content-Type: text/plain; charset=utf-8\r\n\r\n" fcgi.print("Unknown CGI application: `" .. app .. "'\n") end end