This file contains hidden or 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
local track={} | |
setmetatable(track,{__mode="v"}) | |
function setmetatable52(t,mt) | |
if mt.__gc then | |
local p = newproxy(true) | |
track[p] = t | |
getmetatable(p).__gc = function(p) | |
local mt = debug.getmetatable(t) | |
if mt and rawget(mt, "__gc") then | |
rawget(mt, "__gc")(t) |
This file contains hidden or 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
require('lazyserver')(8000, { | |
-- note that query string is not considered in the pattern | |
["^/(.*)"] = function(self, cap1) | |
self.content_type = 'text/plain' | |
self:write('halo halo, you requested '+self.url[1]+', pattern captured '+cap1+', args supplied '+self.param) | |
return 200 | |
end) | |
} | |
-- for even more lazy: |