Comparison

mod_auto156/mod_auto156.lua @ 4614:5d494dba9c02

mod_auto156: Include the containing object in command output
author Kim Alvefur <zash@zash.se>
date Sat, 03 Jul 2021 20:22:27 +0200
parent 4613:6478442d217f
comparison
equal deleted inserted replaced
4613:6478442d217f 4614:5d494dba9c02
27 end 27 end
28 end 28 end
29 if #uris == 0 then 29 if #uris == 0 then
30 return promise.reject(404); 30 return promise.reject(404);
31 end 31 end
32 return uris; 32 return {links=uris};
33 end); 33 end);
34 end 34 end
35 35
36 module:depends("http"); 36 module:depends("http");
37 module:provides("http", { 37 module:provides("http", {
38 route = { 38 route = {
39 ["GET /*"] = function(_, domain) 39 ["GET /*"] = function(_, domain)
40 return check_domain(domain):next(function(uris) 40 return check_domain(domain):next(function(altmethods)
41 return {headers = {content_type = "application/json"}, body = json.encode({links = uris})}; 41 return {headers = {content_type = "application/json"}, body = json.encode(altmethods)};
42 end); 42 end);
43 end, 43 end,
44 }, 44 },
45 }); 45 });
46 46