I have then also spawned the FCGI workers like so:
spawn-fcgi -a 127.0.0.1 -p 9000 -F 4 -- /usr/bin/wsapi.fcgi --cgilua -f
And if I put the following code in index.lua in the root:
-- Define table
local _M = {};
-- Define run function
function _M.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
return _M;
And that shows me the correct details, but I can't seem to find where any of the POST, GET, SESSION is, so I can make a basic page with it, but can't access anything else? I am really confused. Any help would be awesome, thanks!
I am trying to aim at something similar to PHP, but using Lua, where based on the file loaded via Nginx, I can serve it to the Fast CGI handler and let it process, meaning I can write code (somewhat similarly) to PHP. But I am struggling, I have everything showing data, but for some reason the basic web server information, like URL, GET, POST etc, I can't find.
Hi there,
So I have tried getting this to work with Nginx, and I have it all working using the following Nginx configuration:
I have then also spawned the FCGI workers like so:
spawn-fcgi -a 127.0.0.1 -p 9000 -F 4 -- /usr/bin/wsapi.fcgi --cgilua -f
And if I put the following code in index.lua in the root:
And that shows me the correct details, but I can't seem to find where any of the POST, GET, SESSION is, so I can make a basic page with it, but can't access anything else? I am really confused. Any help would be awesome, thanks!
I am trying to aim at something similar to PHP, but using Lua, where based on the file loaded via Nginx, I can serve it to the Fast CGI handler and let it process, meaning I can write code (somewhat similarly) to PHP. But I am struggling, I have everything showing data, but for some reason the basic web server information, like URL, GET, POST etc, I can't find.
Any help would be super appreciated.
Thanks,