16 lines
413 B
Lua
16 lines
413 B
Lua
---
|
|
--- Generated by EmmyLua(https://github.com/EmmyLua)
|
|
--- Created by admin.
|
|
--- DateTime: 2025/9/24 18:14
|
|
---
|
|
|
|
local cjson = require("cjson.safe")
|
|
local dict = ngx.shared.routes_cache
|
|
ngx.req.read_body()
|
|
local body = ngx.req.get_body_data()
|
|
local new_rules = cjson.decode(body)
|
|
for path, target in pairs(new_rules) do
|
|
dict:set(path, target)
|
|
end
|
|
ngx.say(cjson.encode({ status = "ok", count = #new_rules }))
|