summaryrefslogtreecommitdiffhomepage
path: root/applications/sgi-webuci/root/lib
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-05-08 15:37:41 +0000
committerSteven Barth <steven@midlink.org>2008-05-08 15:37:41 +0000
commitaa9ccf77c6648515ba58c37b9345cdbd561028db (patch)
treeb0270202d47b6c5e179f8475302bb3ef0d1c9402 /applications/sgi-webuci/root/lib
parenta3a51464fd8cffa6d18fa3f18be9c699901abd0d (diff)
* Mördercommit ;-)
* Major Repository Reorganisation * API 0.4 Softfreeze to come
Diffstat (limited to 'applications/sgi-webuci/root/lib')
-rw-r--r--applications/sgi-webuci/root/lib/webuci/main.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/applications/sgi-webuci/root/lib/webuci/main.lua b/applications/sgi-webuci/root/lib/webuci/main.lua
new file mode 100644
index 0000000000..50ac8184b7
--- /dev/null
+++ b/applications/sgi-webuci/root/lib/webuci/main.lua
@@ -0,0 +1,23 @@
+package.path = "/usr/lib/lua/?.lua;/usr/lib/lua/?/init.lua;" .. package.path
+package.cpath = "/usr/lib/lua/?.so;" .. package.cpath
+module("webuci", package.seeall)
+
+function prepare_req(uri)
+ env = {}
+ env.REQUEST_URI = uri
+ require("ffluci.menu").get()
+end
+
+function init_req(context)
+ env.SERVER_PROTOCOL = context.server_proto
+ env.REMOTE_ADDR = context.remote_addr
+ env.REQUEST_METHOD = context.request_method
+ env.PATH_INFO = "/" .. context.uri
+ env.REMOTE_PORT = context.remote_port
+ env.SERVER_ADDR = context.server_addr
+ env.SCRIPT_NAME = env.REQUEST_URI:sub(1, #env.REQUEST_URI - #env.PATH_INFO)
+end
+
+function handle_req(context)
+ require("ffluci.dispatcher").httpdispatch()
+end \ No newline at end of file