aproxy/main.lua

24 lines
453 B
Lua
Raw Normal View History

2022-12-06 03:36:15 +00:00
-- function loadConfig()
-- -- TODO load config_path
-- return require("./config.lua")
-- end
--
-- local config = loadConfig()
2022-12-06 18:53:20 +00:00
local ctx = require('ctx')
2022-12-07 17:57:07 +00:00
local config = require('config')
require('util')
2022-12-06 18:54:16 +00:00
2022-12-07 17:57:07 +00:00
ctx:loadFromConfig(config.loadConfigFile())
2022-12-06 03:36:15 +00:00
2022-12-07 18:40:48 +00:00
return {
init=function ()
-- validate config and print out errors
config.loadConfigFile({validate = true})
2022-12-07 18:40:48 +00:00
end,
access=function()
ctx:onRequest()
end
}