module "luci.lucid.http.LuciWebPublisher"
+
+--- Prepare a LuCI web publisher and assign it to a given Virtual Host.
+-- @param server HTTP daemon object
+-- @param config publisher configuration
function factory(server, config)
pcall(function()
require "luci.dispatcher"
end
end
+ local mypath
if type(config.virtual) == "table" then
for _, v in ipairs(config.virtual) do
+ mypath = mypath or v
vhost:set_handler(v, handler)
end
else
- vhost:set_handler(config.virtual, handler)
+ mypath = config.virtual
+ vhost:set_handler(config.virtual or "", handler)
+ end
+
+ if config.home then
+ vhost.default = mypath
end
-end
\ No newline at end of file
+end