Skip to content

buster1253/webcore

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

init_by_lua_block {
    require ("webcore"){name = "core", prefix = "bjne"}
}

http {
    location / {
        access_by_lua_block {
            webcore()
        }

        content_by_lua_block {
            webcore()
        }
    }
}

requires

https://github.com/bjne/lua-resty-require

usage

place a list of the plugins you want to hook in in:

package.path/{{ prefix }}/plugins/{{ name }}.lua

example

bjne/plugins/core.lua

return {
    "bjne.foo",
    "bjne.bar"
}

bjne/bar.lua

return {
    access = {
        action = function() return true end
    },
    content = {
        action = function() return true, nil, ngx.say("bar") end,
        after = "bjne.foo"
    }
}

bjne/foo.lua

return {
    content = {
        action = function() return true, nil, ngx.say("foo") end
    }
}

[comment]: <> # vim: ts=4 et

About

openresty framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%