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')
|
2022-12-07 18:30:22 +00:00
|
|
|
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
|
2022-12-07 18:49:45 +00:00
|
|
|
config.loadConfigFile({validate = true})
|
2022-12-07 18:40:48 +00:00
|
|
|
end,
|
|
|
|
access=function()
|
|
|
|
ctx:onRequest()
|
|
|
|
end
|
|
|
|
}
|