mirror of
https://github.com/Safe3/openresty-manager.git
synced 2025-10-04 13:51:53 +08:00
16 lines
342 B
Lua
16 lines
342 B
Lua
local cjson = require("cjson.safe")
|
|
|
|
collectgarbage("collect")
|
|
local f = io.open("/opt/om/nginx/lua/cfg.json", "r")
|
|
local content = f:read("*a")
|
|
f:close()
|
|
local cfg = cjson.decode(content)
|
|
|
|
-- init modules
|
|
local ok, res
|
|
ok, res = pcall(require, "om")
|
|
if not ok then
|
|
error("require failed: " .. tostring(res))
|
|
else
|
|
res.set_config(cfg)
|
|
end
|