3 require("luci.httpd.server")
4 require("luci.httpd.handler.file")
5 require("luci.httpd.handler.luci")
8 DOCROOT = SYSROOT .. arg[2]
11 collectgarbage("setpause", 150)
13 serversocket = luci.httpd.Socket("0.0.0.0", PORT)
15 server = luci.httpd.server.Server()
16 vhost = luci.httpd.server.VHost()
18 server:set_default_vhost(vhost)
20 if pcall(require, "uci") and pcall(require, "luci.model.uci") then
21 luci.model.uci.cursor = function(config, ...)
22 return uci.cursor(config or SYSROOT .. "/etc/config", ...)
27 luci.sys.user.checkpasswd = function() return true end
30 filehandler = luci.httpd.handler.file.Simple(DOCROOT)
31 vhost:set_default_handler(filehandler)
33 lucihandler = luci.httpd.handler.luci.Luci()
34 vhost:set_handler("/luci", lucihandler)
36 io.stderr:write("Starting LuCI HTTPD on port " .. PORT .. "...\n")
37 io.stderr:write("Point your browser to http://localhost:" .. PORT .. "/luci\n")
39 --daemon = luci.httpd.Daemon()
41 luci.httpd.register(serversocket, server:create_daemon_handlers())