examples/lua-example.lua
changeset 33 ba41bfbe87a2
parent 22 822094314703
equal deleted inserted replaced
32:6dc2d52e4b13 33:ba41bfbe87a2
    11 -- temporary redirect to a different site, every other second.
    11 -- temporary redirect to a different site, every other second.
    12 -- why would you want to do this?  you probably wouldn't.  just illustrating
    12 -- why would you want to do this?  you probably wouldn't.  just illustrating
    13 -- how easy it is to do custom stuff.
    13 -- how easy it is to do custom stuff.
    14 --
    14 --
    15 if os.time() % 2 == 0 then
    15 if os.time() % 2 == 0 then
    16 	return string.format( "%d:http://example.com%s", redir, request.path )
    16 	return string.format( "OK status=%d url=http://example.com%s", redir, request.path )
    17 end
    17 end
    18 
    18