Renamed FFLuCI to LuCI, ffluci to luci and Freifunk Lua Configuration Interface to...
[project/luci.git] / applications / sgi-webuci / root / lib / webuci / main.lua
1 module("webuci", package.seeall)
2
3 function prepare_req(uri)
4         env = {}
5         env.REQUEST_URI = uri
6         require("luci.dispatcher").createindex()
7 end
8
9 function init_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 end
18
19 function handle_req(context)
20         luci.dispatcher.httpdispatch()
21 end