Software /
code /
prosody-modules
Comparison
mod_rest/apidemo.lib.lua @ 4728:1c6d353550cc
mod_rest: Correct option name in error message
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 27 Oct 2021 14:06:34 +0200 |
parent | 4550:0befc680970b |
child | 4928:d5612dcf6733 |
comparison
equal
deleted
inserted
replaced
4727:e6f46d1b3337 | 4728:1c6d353550cc |
---|---|
9 path = api_demo; | 9 path = api_demo; |
10 mime_map = mime_map; | 10 mime_map = mime_map; |
11 }); | 11 }); |
12 | 12 |
13 local index do | 13 local index do |
14 local f = assert(io.open(api_demo.."/index.html"), "'api_demo_resources' should point to the 'dist' directory"); | 14 local f = assert(io.open(api_demo.."/index.html"), "'rest_demo_resources' should point to the 'dist' directory"); |
15 index = f:read("*a"); | 15 index = f:read("*a"); |
16 f:close(); | 16 f:close(); |
17 | 17 |
18 -- SUCH HACK, VERY GSUB, WOW! | 18 -- SUCH HACK, VERY GSUB, WOW! |
19 index = index:gsub("(%s?url%s*:%s*)%b\"\"", string.format("%%1%q", module:http_url().."/demo/openapi.yaml"), 1); | 19 index = index:gsub("(%s?url%s*:%s*)%b\"\"", string.format("%%1%q", module:http_url().."/demo/openapi.yaml"), 1); |