membphis commented on code in PR #12718:
URL: https://github.com/apache/apisix/pull/12718#discussion_r2520995829
##########
apisix/admin/standalone.lua:
##########
@@ -347,20 +457,24 @@ local function head(ctx)
return core.response.exit(200)
end
-
function _M.run()
Review Comment:
another Lua style:
```lua
function _M.run()
local ctx = ngx.ctx.api_ctx
local method = str_lower(get_method())
if method == "put" then
return update(ctx)
end
if method == "post" then
local path = ctx.var.uri
if path == "/apisix/admin/configs/validate" then
return validate(ctx)
else
return core.response.exit(404, {error_msg = "Not found"})
end
end
if method == "head" then
return head(ctx)
end
-- default is get
return get(ctx)
end
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]