Created
March 29, 2010 01:06
-
-
Save ayourtch/347210 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function default_page(page, req, resp, params) | |
local form = { | |
{ "text", name = "textfield", id = "stTagInput", autocomplete = "off", class = "input-text", | |
value = params.test, title = "this is a text" }, | |
{ "submit", value = "set", class = "input-btn" }, | |
method = "post", action = "post", id = "UpdateForm" | |
} | |
page.myform = form | |
include("test.html", page, req, resp, params) | |
end | |
-- more functions here | |
routing { | |
print = print, read = read, | |
get { "/login/(.+)/(.+)", login, params = { | |
test = { optional, numeric }, | |
something = { optional }, | |
path_capture_1 = { mandatory, lisp_like_id }, | |
path_capture_2 = { mandatory, numeric }, | |
}, | |
on_error = paint_form, | |
}, | |
post { "/k", postfunc }, | |
get { "/status", status_func }, | |
post { "/post", postfunc, params = { | |
textfield = { mandatory }, | |
}, | |
on_error = paint_form, | |
}, | |
get { "/", default_page, params = { | |
test = { optional }, | |
} | |
}, | |
get { "/skin/(.+)", skin_page, params = { | |
test = { optional }, | |
path_capture_1 = { mandatory }, | |
}, | |
on_error = paint_form, | |
}, | |
post { "/", default_page }, | |
get { ".*", redirect_request_to("/") }, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment