On Wednesday, April 26, 2017 at 6:58:45 PM UTC+3, rpaprocki wrote:
Just curious, what does conf/view.lua look like?
# cat view.lua
local template = require "resty.template"
-- Using template.new
local view = template.new "view.html"
view.message = "Hello, World!"
view:render()
BTW You may want to contact the author of this module directly (via GitHub); this mailing list is for openresty in general, not individual projects. :)
Thanks for the tip
Sent from my iPhone
As per the directions at:
https://github.com/bungle/lua-resty-template#installation
I installed lua-resty-template via luarocks and copied the template.lua and template directory to /usr/local/openresty/lualib/resty. I created a view.html file in the html directory and a view.lua script under conf to run the example lua code provided in the documentation. The nginx.conf location configuration is:
location /view.html {
content_by_lua_file conf/view.lua;
add_header Content-Type text/html;
}
however I still see {{message}} in the HTML response body. What step am I missing?
thanks!
.