---
name: "wsapi.cgi"
section: "1"
platform: "linux"
package: "lua-wsapi"
version: "1.6.1-3+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/wsapi.cgi"
---

# wsapi.cgi(1)

cgi wrapper for wsapi based dynamic pages

## NAME

**wsapi.cgi** - cgi wrapper for wsapi based dynamic pages

## SYNOPSIS

```
#!/usr/bin/env wsapi.cgi
```

## DESCRIPTION

**A sample dynamic page follows:**

```
    #!/usr/bin/env wsapi.cgi
    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
```

## AUTHOR

**Enrico Tassi \<gareuselesinge@debian.org\>**
