summaryrefslogtreecommitdiff
path: root/example/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'example/main.lua')
-rw-r--r--example/main.lua6
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)