kernelsauce / turbo

Turbo is a framework built for LuaJIT 2 to simplify the task of building fast and scalable network applications. It uses a event-driven, non-blocking, no thread design to deliver excellent performance and minimal footprint to high-load applications while also providing excellent support for embedded uses.
http://turbo.readthedocs.io/
Apache License 2.0
528 stars 84 forks source link

Running lua scripts through get request #186

Closed SanjanaSridhar closed 9 years ago

SanjanaSridhar commented 9 years ago

Hello is it possible to run a lua script through the get request?

Thanks

kernelsauce commented 9 years ago

What do you want to do? Run a Lua script that comes in as a argument in a GET request? Or run a Lua script when you get a GET request?

SanjanaSridhar commented 9 years ago

I want to run a lua script when I get a GET request. Thank you.

kernelsauce commented 9 years ago

Well Lua has a builtin function for just that. Running it in the context of GET request in Turbo doesnt really change anything:

http://www.lua.org/manual/5.2/manual.html#pdf-loadfile

loadfile ([filename [, mode [, env]]])

Similar to load, but gets the chunk from file filename or from the standard input, if no file name is given.

SanjanaSridhar commented 9 years ago

Thank you so much!