Closed laulin closed 5 months ago
Can you be more specific? which example are you trying to run?
I found the problem : in Handler:processRequest (handler.lua:137), the fonction expectes the callback return something (eg true) otherwise it will return the error message. So the example should be :
local Pegasus = require 'pegasus'
local server = Pegasus:new({location="/index.html"})
server:start(function (req, res)
res:addHeader('Content-Type', 'text/html'):write('hello pegasus world!')
return true
end)
Mind creating a PR with a fix for the example?
Sure, I just did it. But examples "copas.lua" and "app.lua" can't be fixed : pegasus.json is missing in the repository. Do you know why this feature was removed ?
dang, yup, that was never merged, see #138 .
I'll send a fix for that one.
EDIT: fix is in #145
@laulin I think this can be closed now, PR's have been merged.
Closing it, thanks guys! @laulin please feel free to reopen this if needed.
Hello,
I was just looking at this library, I install it and when I run basic example (write.lua, querystring.lua, ...), it crashes with following error :
I read response.lua, I saw the flag "_headersSended" but I dont catch the meaning of assert(not _headersSended ...). May be someone can explain that part ?
Thank you for your time !