Software / code / prosody-modules
Comparison
mod_rest/apidemo.lib.lua @ 5220:d03448560acf
mod_rest: Point URLs to mod_http_oauth2 in demo mode
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 07 Mar 2023 14:59:45 +0100 |
| parent | 4928:d5612dcf6733 |
comparison
equal
deleted
inserted
replaced
| 5219:25e824f64fd3 | 5220:d03448560acf |
|---|---|
| 25 index = index:gsub("(%s*SwaggerUIBundle%s*%(%s*{)(%s*)", "%1%2validatorUrl: false,%2"); | 25 index = index:gsub("(%s*SwaggerUIBundle%s*%(%s*{)(%s*)", "%1%2validatorUrl: false,%2"); |
| 26 end | 26 end |
| 27 | 27 |
| 28 do | 28 do |
| 29 local f = module:load_resource("res/openapi.yaml"); | 29 local f = module:load_resource("res/openapi.yaml"); |
| 30 local openapi = f:read("*a"); | |
| 31 openapi = openapi:gsub("https://example%.com/oauth2", module:http_url("oauth2")); | |
| 30 _M.schema = { | 32 _M.schema = { |
| 31 headers = { | 33 headers = { |
| 32 content_type = "text/x-yaml"; | 34 content_type = "text/x-yaml"; |
| 33 }; | 35 }; |
| 34 body = f:read("*a"); | 36 body = openapi; |
| 35 } | 37 } |
| 36 f:close(); | 38 f:close(); |
| 37 end | 39 end |
| 38 | 40 |
| 39 _M.redirect = { | 41 _M.redirect = { |