diff 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
parents d5612dcf6733
children
line wrap: on
line diff
--- a/mod_rest/apidemo.lib.lua	Tue Mar 07 13:19:19 2023 +0000
+++ b/mod_rest/apidemo.lib.lua	Tue Mar 07 14:59:45 2023 +0100
@@ -27,11 +27,13 @@
 
 do
 	local f = module:load_resource("res/openapi.yaml");
+	local openapi = f:read("*a");
+	openapi = openapi:gsub("https://example%.com/oauth2", module:http_url("oauth2"));
 	_M.schema = {
 		headers = {
 			content_type = "text/x-yaml";
 		};
-		body = f:read("*a");
+		body = openapi;
 	}
 	f:close();
 end