hook.io icon indicating copy to clipboard operation
hook.io copied to clipboard

Better lua support

Open Marak opened this issue 8 years ago • 2 comments

We've been getting a few requests for better lua support.

So far we have:

  • added socket, json, crypto and ssl packages.

We should:

  • install more common and useful packages via luarocks
  • allow ability for users to automatically install rocks with luarocks
  • add more lua examples
  • add lua table support for Hook.env and Hook.params https://github.com/Stackvana/microcule/issues/18

@teamflower -

Do you have any additional suggestions for improving Lua support? This is a good place to bring them up.

Marak avatar Jan 08 '17 20:01 Marak

Thanks, @Marak. Some guidance or improvements on using logging with Lua would be helpful: https://hook.io/logs

Just a couple example lines for Lua on the page would be 🎉 Not sure where to start.

teamflower avatar Jan 09 '17 03:01 teamflower

@teamflower -

So it's technically possible to do this right now using something like:

io.stderr:write('{ "type": "log", "payload": { "entry": "hello logs"}}')

That should send "hello logs" to the service logs. In addition to the above listed items, I'm going to write a convenience method for the lua services called log that will automatically wrap the above statement into a single function.

Thanks for the suggestion!

Marak avatar Jan 09 '17 04:01 Marak