You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lapis new --lua
wrote nginx.conf
wrote mime.types
wrote app.lua
wrote models.lua
app.lua:
local lapis = require("lapis")
local cached = require("lapis.cache").cached
local app = lapis.Application()
app:match("/microcached", cached({
exptime = 1,
function(self)
return "hello world!"
end
}))
return app
GET /microcached?foo
Error
...cal/openresty/luajit/share/lua/5.1/lapis/nginx/cache.lua:71: attempt to index local 'dict' (a nil value)
Traceback
stack traceback:
...cal/openresty/luajit/share/lua/5.1/lapis/nginx/cache.lua:71: in function 'handler'
...cal/openresty/luajit/share/lua/5.1/lapis/application.lua:146: in function 'resolve'
...cal/openresty/luajit/share/lua/5.1/lapis/application.lua:183: in function <...cal/openresty/luajit/share/lua/5.1/lapis/application.lua:181>
[C]: in function 'xpcall'
...cal/openresty/luajit/share/lua/5.1/lapis/application.lua:189: in function 'dispatch'
/usr/local/openresty/luajit/share/lua/5.1/lapis/nginx.lua:231: in function 'serve'
content_by_lua(nginx.conf.compiled:22):2: in main chunk
You need nginx.conf add the line:
http {
lua_shared_dict page_cache 10m;
...
}
and then everything works.
The text was updated successfully, but these errors were encountered:
OpenResty 1.19.3.1, Lapis 1.8.3.
New project:
app.lua:
GET /microcached?foo
You need nginx.conf add the line:
and then everything works.
The text was updated successfully, but these errors were encountered: