2 LuCI - Lua Configuration Interface
4 Copyright 2009 Steven Barth <steven@midlink.org>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
15 local require, ipairs, pcall = require, ipairs, pcall
16 local srv = require "luci.lucid.http.server"
18 module "luci.lucid.http"
20 --- Prepare the HTTP-daemon and its associated publishers.
21 -- @param publisher Table of publishers
22 -- @return factory callback or nil, error message
23 function factory(publisher)
24 local server = srv.Server()
25 for _, r in ipairs(publisher) do
27 local s, mod = pcall(require, "luci.lucid.http." .. (r[".type"] or ""))
29 mod.factory(server, r)
35 return function(...) return server:process(...) end