update
Browse files
app.lua
CHANGED
|
@@ -12,17 +12,16 @@ local api_pxoxy_pass_url_indicator = ''
|
|
| 12 |
|
| 13 |
-- ζεηζ¬ε·ε proxy_pass url ζ θ―
|
| 14 |
if uri == '/' then
|
| 15 |
-
ngx.say("uri = /")
|
| 16 |
ngx.exit(ngx.HTTP_OK)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
else
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
api_version = version_match[1]
|
| 21 |
-
api_pxoxy_pass_url_indicator = version_match[2]
|
| 22 |
-
else
|
| 23 |
-
api_version = ''
|
| 24 |
-
api_pxoxy_pass_url_indicator = ''
|
| 25 |
-
end
|
| 26 |
end
|
| 27 |
|
| 28 |
ngx.say("api_version: ", api_version)
|
|
|
|
| 12 |
|
| 13 |
-- ζεηζ¬ε·ε proxy_pass url ζ θ―
|
| 14 |
if uri == '/' then
|
|
|
|
| 15 |
ngx.exit(ngx.HTTP_OK)
|
| 16 |
+
end
|
| 17 |
+
|
| 18 |
+
local version_match = string.match(uri, "^(v%d+)/(.*)")
|
| 19 |
+
if version_match then
|
| 20 |
+
api_version = version_match[1]
|
| 21 |
+
api_pxoxy_pass_url_indicator = version_match[2]
|
| 22 |
else
|
| 23 |
+
api_version = ''
|
| 24 |
+
api_pxoxy_pass_url_indicator = ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
end
|
| 26 |
|
| 27 |
ngx.say("api_version: ", api_version)
|