* Mördercommit ;-)
[project/luci.git] / applications / sgi-webuci / root / lib / webuci / main.lua
1 package.path  = "/usr/lib/lua/?.lua;/usr/lib/lua/?/init.lua;" .. package.path
2 package.cpath = "/usr/lib/lua/?.so;" .. package.cpath
3 module("webuci", package.seeall)
4
5 function prepare_req(uri)
6         env = {}
7         env.REQUEST_URI = uri
8         require("ffluci.menu").get()
9 end
10
11 function init_req(context)
12         env.SERVER_PROTOCOL = context.server_proto
13         env.REMOTE_ADDR     = context.remote_addr
14         env.REQUEST_METHOD  = context.request_method
15         env.PATH_INFO       = "/" .. context.uri
16         env.REMOTE_PORT     = context.remote_port
17         env.SERVER_ADDR     = context.server_addr
18         env.SCRIPT_NAME     = env.REQUEST_URI:sub(1, #env.REQUEST_URI - #env.PATH_INFO)
19 end
20
21 function handle_req(context)
22         require("ffluci.dispatcher").httpdispatch()
23 end