diff options
| author | unwox <me@unwox.com> | 2025-01-27 17:44:25 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2025-01-27 17:44:25 +0600 |
| commit | ef75533bc54fdaa84dbb1e4a3a213af57fad3915 (patch) | |
| tree | 2132179ba3f5271eb063286b8099c22eadd872ff /example | |
| parent | c71a1b5ab5d7fbbf4613f0e130a205134875092f (diff) | |
add both camelCase and kebab-case versions of API functions
Diffstat (limited to 'example')
| -rw-r--r-- | example/main.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/example/main.lua b/example/main.lua index 98e3ea8..335eaad 100644 --- a/example/main.lua +++ b/example/main.lua @@ -97,7 +97,7 @@ luna.router.static("GET /static/", "static/") -- luna stdio when it's run with -D flag. in this case we print the result of -- evaluation. eval handler is evaluated once for each worker so the result -- may be printed more than once -luna.evalfn(function (text) - local res = loadstring(text) - print(res) +luna.onEval(function (text) + local res = (_G.loadstring or _G.load)(text) + res() end) |
