Browse Source

[YQTemplate] add content type

main
Annwan 4 months ago
parent
commit
1573055d13
  1. 4
      main.lua
  2. 3
      yqtemplate.lua

4
main.lua

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

3
yqtemplate.lua

@ -1,3 +1,4 @@
return function(fcgi)
fcgi.print"Hello from application `YQTemplate'"
fcgi.print("Content-Type: text/plain; charset=utf-8\r\n\r\n")
fcgi.print("Hello from application `YQTemplate'")
end
Loading…
Cancel
Save