wsapi.fcgi(1)

πŸ“¦ version 1.6.1, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– wsapi.fcgi β€” bestie edition πŸ’–

okay so this is wsapi.fcgi, section 1 of the wsapi docs, and it's literally the fast cgi wrapper for your wsapi-based dynamic pages. that's the whole vibe. πŸ¦‹


✨ SYNOPSIS ✨

FCGIWrapper wsapi.fcgi .lua

🌸 DESCRIPTION 🌸

so if you're running Apache, bestie, you're gonna wanna drop these lines in to define a handler for your .lua files. like, this is the move:

AddHandler fcgid-script .lua
FCGIWrapper /usr/bin/wsapi.fcgi .lua

and here's a lil sample dynamic page so you can see what it's giving πŸ‘‘:

#!/usr/bin/env wsapi.fcgi

module(..., package.seeall)

function run(wsapi_env)
  local headers = { ["Content-type"] = "text/html" }

  local function hello_text()
    coroutine.yield("<html><body>")
    coroutine.yield("<p>Hello Wsapi!</p>")
    coroutine.yield("<p>PATH_INFO: " .. wsapi_env.PATH_INFO .. "</p>")
    coroutine.yield("<p>SCRIPT_NAME: " .. wsapi_env.SCRIPT_NAME .. "</p>")
    coroutine.yield("</body></html>")
  end

  return 200, headers, coroutine.wrap(hello_text)
end

no cap, that's it. πŸ’…


πŸ‘€ SEE ALSO πŸ‘€


πŸŽ€ AUTHOR πŸŽ€

Enrico Tassi <gareuselesinge@debian.org> β€” icon, legend, wrote the whole thing, we stan πŸ’œ


that's the tea, bestie β€” this page is from the wsapi docs, dated 28 April 2009, and it's wsapi.fcgi(1), so now you know fr fr. go slay those dynamic pages. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from