* Updated dispatching cache mechanism
[project/luci.git] / libs / sgi-webuci / root / lib / webuci / main.lua
1 module("webuci", package.seeall)
2
3 function prepare_req(uri)
4 require("luci.dispatcher").createindex()
5 env = {}
6 env.REQUEST_URI = uri
7 end
8
9 function handle_req(context)
10 env.SERVER_PROTOCOL = context.server_proto
11 env.REMOTE_ADDR = context.remote_addr
12 env.REQUEST_METHOD = context.request_method
13 env.PATH_INFO = context.uri
14 env.REMOTE_PORT = context.remote_port
15 env.SERVER_ADDR = context.server_addr
16 env.SCRIPT_NAME = env.REQUEST_URI:sub(1, #env.REQUEST_URI - #env.PATH_INFO)
17
18 luci.sgi.webuci.initenv(env)
19 luci.dispatcher.httpdispatch()
20 end