plain module

This commit is contained in:
hladu357 2024-06-03 18:47:10 +02:00
commit 392635af86
2 changed files with 29 additions and 0 deletions

24
conf/nginx.conf Normal file
View File

@ -0,0 +1,24 @@
daemon off;
master_process off;
error_log /dev/stdout info;
events {
worker_connections 1024;
}
http {
access_log /dev/stdout;
lua_package_path "$prefix/lua/?.lua;;";
server {
listen 80;
location / {
default_type text/plain;
content_by_lua_block {
local key_header = require "key_header"
key_header.greet("a Lua module")
}
}
}
}

5
lua/key_header.lua Normal file
View File

@ -0,0 +1,5 @@
local _M = {}
function _M.greet(name)
ngx.say("Greetings from ", name)
end
return _M